Repository navigation
fix(arrs): find a Sonarr episode by release name when its path matches no series - #1067
Open
firestaerter3 wants to merge 1 commit into
Open
firestaerter3 wants to merge 1 commit into
firestaerter3 wants to merge 1 commit into
Conversation
…s no series When a repair cannot find the series by the file's mount path, ask Sonarr to parse the release name (the release folder, or the file name when it sits directly in a category folder) and act only when the answer is unambiguous: - the parsed episodes link to one episode file whose sceneName is this release: the normal repair runs on that file (blocklist, delete, search); - none of the parsed episodes has a file: search them through the failure breaker; nothing is blocklisted or deleted. Anything else (Sonarr already uses another release, the file has no scene name, episodes of more than one series, hasFile without a file id) keeps the old behaviour. Sonarr stores the path of its own library entry, which is often a symlink into the mount, so the path lookup alone misses these files and the broken file was left in place with nothing searched. ParseContext is added to SonarrClient. The legacy (v3) adapter gets it from starr; the native (v5) adapter returns ErrParseUnsupported for now, so on v5 the fallback does nothing and the old behaviour stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1066.
When the repair cannot find the series by the file's mount path, it now asks Sonarr to parse the release name (the release folder, or the file name when the file sits directly in a category folder). It only acts when the result is unambiguous:
sceneNameis this release: the normal repair runs on that file (blocklist, delete, search);Everything else keeps the current behaviour: Sonarr already uses another release, the file has no scene name, episodes of more than one series, or
hasFilewithout a file id.ParseContextis added toSonarrClient. The legacy (v3) adapter gets it from starr. The native (v5) adapter returnsErrParseUnsupportedfor now, because I could not confirm the v5 parse endpoint, so on v5 the fallback does nothing.Tests:
internal/arrs/scanner/sonarr_parse_fallback_test.gocovers the release-name rules and each decision.go vet ./internal/... ./cmd/...andgo test ./internal/arrs/...pass. On the 26 files from the issue it would repair 9 and search 8; the other 9 are left alone (7 where Sonarr uses another release, 2 with no scene name).