github Listenarrs/Listenarr v1.5.13-canary
Canary 1.5.13

latest release: v1.5.14-canary
pre-release4 hours ago

Fixes #1056
Fixes #1057

Summary

Both issues come from how qualityProfileId is handled on the library edit paths, so I think they fit in one small change. I compared against #760's file list and, as far as I can tell, it only validates the add and monitoring paths, so the two do not overlap: none of the files this touches appear in it.

  • #1056: PUT /library/{id} with qualityProfileId: -1 ("use default") and no default profile configured set the book's profile to null. That discarded the existing assignment and, I think, dropped the book out of auto-search.
  • #1057: single update and bulk edit stored any requested id without checking that the profile exists. Bulk edit also did not handle the -1 sentinel at all, so it stored -1 literally. The issue did not mention that part, I found it while reading the bulk path.

Changes

Added

  • LibraryQualityProfileSelection.ResolveAsync, one helper that turns a requested id into an existing profile id (resolving -1 to the default) or throws ApplicationValidationException.

Fixed

  • Single update resolves the profile before any other change is applied, and returns the existing 400 mapping (ToApplicationExceptionResult) if it cannot. A rejected request leaves the current assignment alone. It also runs before the deprecated BasePath rewrite, so I think a bad profile id should not leave a half-applied update behind.
  • Bulk edit resolves -1 to the default profile id and checks existence, and reports a rejection in that item's errors list like its other per-item failures.
  • ApplyQualityProfileAsync is removed; the helper replaces its lookup and ApplyMetadataUpdatesAsync just assigns the resolved id.

Testing

Seven new tests in LibraryController_QualityProfileSelectionTests (corpus book A Princess of Mars), driven through UpdateAudiobook and BulkUpdateAudiobooks with the real repositories.

Control, same test file on unmodified canary b734292: 5 of 7 fail...


Automated Canary build

Don't miss a new Listenarr release

NewReleases is sending notifications on new releases.