diff --git a/README.md b/README.md index 823ae9f..7eb1619 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ Here are the app config items (they are all optional): | `comicTagServices` | `["all known tags"]` | An array of tag service names that will be used for comic title, volume, chapter, and page tags. They will be used in the order given. | | `comicFullThumbs` | `false` | A boolean indicating whether to show full thumbnails in the comic gallery view. If set to `false` thumbnails will be cropped in to fill the thumb container. If true the container will be a square unless `comicThumbAspectRatio` is set. | | `comicThumbAspectRatio` | | The aspect ratio for comic thumbnails. If this is unset the aspect ratio of the files will be used. Accepts any valid [CSS aspect-ratio value](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio). If you have "thumbnail scaling" set to "scale to fill" in your Hydrus settings you should set this to the aspect ratio of your set thumbnail dimensions. This can also be used to restrict normal thumbnail to a specific aspect like `1/1.5`. | +| `comicTitleOverrides` | | A JSON object of comic paths to title strings. The comic titles here override any tags on the files. | ## Running as a service diff --git a/src/comic/comic.service.ts b/src/comic/comic.service.ts index 309a041..44c8768 100644 --- a/src/comic/comic.service.ts +++ b/src/comic/comic.service.ts @@ -112,9 +112,11 @@ export class ComicService { this.logger.debug(`Comic cache MISS (${id})`); const pages = await firstValueFrom(this.getComicPagesFromApi(id)); const title = - this.appConfig.comicTitleFromNamespace && pages[0] - ? this.getTitle(pages[0]) ?? id - : id; + this.appConfig.comicTitleOverrides && this.appConfig.comicTitleOverrides.hasOwnProperty(id) + ? this.appConfig.comicTitleOverrides[id] + : this.appConfig.comicTitleFromNamespace && pages[0] + ? this.getTitle(pages[0]) ?? id + : id; const comicFromApi = { title, pages, diff --git a/src/config.ts b/src/config.ts index 493ec42..0a85e24 100644 --- a/src/config.ts +++ b/src/config.ts @@ -196,4 +196,8 @@ export class AppConfig { @IsString() @IsOptional() public readonly comicThumbAspectRatio?: string; + + @IsObject() + @IsOptional() + public readonly comicTitleOverrides?: Record; }