Skip to content

fix(authors): fill the missing format root folder from the default when an author is added - #219

Open
jordanfelle wants to merge 2 commits into
Chaptarr:developfrom
jordanfelle:fix-author-default-root-folders
Open

jordanfelle wants to merge 2 commits into
Chaptarr:developfrom
jordanfelle:fix-author-default-root-folders

Conversation

@jordanfelle

@jordanfelle jordanfelle commented Sep 26, 2026 •

Copy link
Copy Markdown

Problem

Import paths create an author for the one format being imported and leave the other format's root folder blank. Measured on a live instance: 509 audiobook-only and 303 ebook-only authors created in one week. Those authors are rejected by "sync monitored across formats" (it requires both roots; the bulk editor warned "Sync was enabled for 1899 author(s). 509 author(s) were skipped because both audiobook and ebook root folders are required."), and later imports of the other format fail with "No root folder configured for quality type".

Fix

AuthorService.AddAuthor/AddAuthors fill each blank root from the effective default root folder for that format (the configured default, else the only compatible root). Explicit values are never overwritten, and a root is left blank when the default is missing or ambiguous. AuthorPathBuilder.BuildPathForQuality still throws for a format the author has no root for (intentional signal).

Verification

  • New AuthorServiceDefaultRootFoldersFixture (fill both directions, no overwrite, ambiguous default, configured default with several roots, no roots).
  • Core tests pass (3,026 on top of develop).
  • Not yet confirmed live on a newly created author.

Behaviour note: a filled root has effects beyond the path. EnsureAuthorDbFields copies that root folder's default quality and metadata profiles and monitored flags onto the author, so an author added for one format now also gets the other format's profiles and monitoring from the root's defaults, and becomes eligible for sync across formats (seeded only if the root folder has an explicit sync default). Pending-import adds previously left that format's profile at 0. This is add-time only and not opt-out; with automatic search enabled it can start grabbing the second format.

  • Adds a DI test that resolves AuthorService from a real DryIoc container with the app's rules and checks the configured default is honoured, i.e. the optional IConfigService argument is injected in production (3,027 core tests pass).

… is added

Import paths create an author for the one format being imported and leave the other format's root folder blank (measured on a live instance: 509 audiobook-only and 303 ebook-only authors created in one week). Those authors are rejected by 'sync monitored across formats', which requires both roots, and later imports of the other format fail with 'No root folder configured for quality type'.

AuthorService.AddAuthor/AddAuthors now fill each blank root from the effective default root folder for that format (the configured default, else the only compatible root). Explicit values are never overwritten, and the root is left blank when the default is missing or ambiguous.
…ptional parameter

configService is an optional constructor parameter (= null). If the container ever fell back to the default, the configured default root folders would silently never apply in production. Resolve AuthorService from a real DryIoc container with the application's rules and check the configured default is honoured.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant