Skip to content

Show when a release was grabbed or failed in Sonarr v5 interactive search - #852

Merged
tillkruss merged 4 commits into
developfrom
feature/sonarr-v5-release-history
Nov 3, 2026
Merged

tillkruss merged 4 commits into
developfrom
feature/sonarr-v5-release-history

Conversation

@tillkruss

@tillkruss tillkruss commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Sibling of #839 for Sonarr. Sonarr v5 adds history: { grabbed, failed } to releases (Sonarr/Sonarr@4c556eac), but only in /api/v5/release. The v3 resource doesn't have it, even on v5 builds.

  • Instance.withAPIVersion (private, in API+Live.swift) sends a request to /api/v5 when the instance is Sonarr with a stored version of 5 or later, otherwise to /api/v3. It falls back to v3 on an empty-body 404, which is what Sonarr v4 returns for an unknown /api route. v5's own "release not in cache" 404 has a JSON message, so it isn't swallowed. The releases and downloadRelease closures only change their path.
  • SonarrV5ReleaseDecoder, a JSONDecoder subclass passed only for the v5 search, flattens release, parsedInfo and decision into the top level, takes the first of seasonNumbers as seasonNumber, and turns rejection objects into their messages. SeriesRelease keeps its synthesized Decodable.
  • DownloadReleaseCommand also sends searchInfo, which v5 reads and v3 ignores (Sonarr's System.Text.Json settings don't reject unknown members). Grabs must go through v5 when the search did, because Sonarr keys its release cache by controller type.
  • The release sheet shows "Grabbed" and "Failed" rows, as in Show when a release was grabbed or failed in Radarr interactive search #839.

Verified:

  • macOS xcodebuild test passes (240 tests) and the iOS simulator build succeeds.
  • The 96 series-releases.json fixtures converted into the v5 shape, with nulls omitted as Sonarr does, decode through SonarrV5ReleaseDecoder to output identical (SHA-256) to the v3 originals. The history dates decode, including 7-digit fractional seconds.
  • Download bodies: Sonarr gets the flat fields plus searchInfo. Radarr and plain grabs are unchanged.

Not verified against a live Sonarr v5 instance, or that v4 really returns an empty 404 for /api/v5/release (inferred from Sonarr's Startup.cs and StaticResourceController).

Caveats:

  • v5 is still a pre-release, so its API can change.
  • instance.version only refreshes when Settings checks the instance or it's edited, so the v5 path starts after an upgrade once Settings has been opened.

🤖 Generated with Claude Code

…arch

Sonarr v5 adds history dates to GET /api/v5/release (Sonarr/Sonarr@4c556eac), but not to /api/v3/release. Sonarr instances reporting version 5 or later now search and grab through /api/v5/release, falling back to v3 on an empty 404. Grabs must use v5 too, because Sonarr caches releases separately for each API version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T21:21:30.808942Z b39184d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

tillkruss and others added 3 commits November 3, 2026 14:31
SeriesRelease now decodes both the flat v3 shape and the nested v5 shape, replacing SeriesReleaseV5. DownloadReleaseCommand also sends searchInfo, which v5 reads and v3 ignores, so search and grab differ only by path through Instance.preferringSonarrV5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SonarrV5ReleaseDecoder reshapes the nested v5 JSON into the v3 shape, so SeriesRelease keeps its synthesized Decodable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MYjz4ojbQ3WH6ZsETB2Pzg
@tillkruss
tillkruss merged commit 955fec2 into develop Nov 3, 2026
6 of 7 checks passed
@tillkruss
tillkruss deleted the feature/sonarr-v5-release-history branch November 3, 2026 22:46
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