Skip to content

feat(downloads): download audiobooks and play them offline - #1192

Merged
Quick104 merged 9 commits into
mainfrom
feat/audiobook-offline-downloads
Nov 16, 2026
Merged

Quick104 merged 9 commits into
mainfrom
feat/audiobook-offline-downloads

Conversation

@Quick104

@Quick104 Quick104 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: changes #339 C4, C9, C10; changes #319 C1

Other clients: Android Silo-Server/silo-android#957; Roku N/A (downloads and offline playback are deferred in docs/spec.md); Web N/A (the web client has no offline downloads)

The Apple apps can't download audiobooks. Android can, so iPhone, iPad and Mac listeners lose their books the moment they go offline. This adds audiobook downloads and offline playback, and sends listening done offline back to the server, which Android doesn't do yet.

Approach

  • Detail page (iPhone, iPad, Mac): Download sits in the action row for a book stored as one file, always as the original file. The server keeps one download per book on a device (downloads_device_entry_uidx is keyed on content), so a book split into several files can't be saved whole and isn't offered. Android saves one part of such a book; that can be one chapter of a long book, so this leaves them out until the server supports whole-book downloads. Speed leaves the action row so the row fits on one line; it stays in the player.
  • Downloads tab: books list as their own rows with a square cover and the author, and the storage bar gets an Audiobooks bucket. The offline page plays a book in the audio player. A manifest's series id no longer groups a book under a TV series.
  • Player: a downloaded part loads from disk with no server playback session, and streams instead if the file won't open. When the server can't be reached, the book opens from its download and stored manifest.
  • Progress: while the server can't be reached, whole-book positions go into the existing offline queue with the time they were sampled (the server merges queued items newest-first). The queue is sent when the server becomes reachable, not only on foreground. At start, unsent local listening is sent first (waiting up to 3 seconds for the server's answer) and the server's reconciled resume point is used; only when the server didn't apply it (refused, deferred, or not answered in time) does the local position win. Starting a download seeds the offline resume point from the server's. Online playback of a downloaded book still uploads directly and keeps the local resume point current.

Validation

  • Unit tests (SiloTests, iOS 27.2 simulator): download grouping, audiobook progress, offline playback mapping, download pipeline and watch-state suites, 84 tests, 0 failures. Three new tests cover book classification and the offline book timeline.
  • Builds: iOS, macOS and tvOS compile.
  • Simulator end to end against a real server: download, local playback while online with no playback session started, offline playback with the server unreachable, offline seek and pause, and the queued position reaching the server when it came back (server row matched the paused position).
  • Installed and launched on a physical iPhone.
  • Not run: progress routing has no unit test (it would need a test-only seam in the player or download store); the simulator run covers it. Not re-run on the simulator after the last review fixes and the Speed removal.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-apple/audiobook-offline-downloads/

Surface and build: iPhone simulator (iOS 27.2), Debug build of this branch. Before captures weren't possible: a main build couldn't sign in to the test server after it started answering 410 on /api/v1/auth/setup (see Risks). Before this change the audiobook action row had no Download and Downloads listed no audiobooks. iPad, Mac and iPhone Duo use the same views and weren't captured; Apple TV has no downloads.

Risks

  • Downloaded playback skips the server playback session, so admin activity doesn't show offline or local listening; whole-book progress still syncs.
  • Books split into several files have no Download until the server can hold a whole book per device.
  • Unrelated, found while testing: servers on current main answer 410 on GET /api/v1/auth/setup (feat(api)!: retire /api/v1 behind a 410 tombstone silo-server#3200 retired /api/v1), and this app's server check still calls it, so signing in to such a server fails. Needs its own fix.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code (T3 Code); a second Claude Code run as advisor; XcodeBuild via MacDev's build service
  • Model(s): claude-opus-5-5 (implementation); claude-fable-5-2 (design and code review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: claude-fable-5-2 reviewed the design, the diff, and the fixes, read-only. It cut multi-part support and author grouping, and found progress bugs: Resume used the detail page's stale position, unsent and in-flight queue entries were ignored at start, a late failed upload could re-queue an old position, and sessions opened offline never uploaded once back online. All were fixed; a re-check found three smaller issues, also fixed. Skipped: flushing right after a failed final save (an unanswered flush holds the entry for good).

🤖 Generated with Claude Code

Note

Add offline audiobook download and playback support in iOS app

  • Adds a single-file audiobook download path in DownloadManager.downloadAudiobook that seeds a local resume point from the server position. Audiobook records get their own list items, storage category, and square cover rows.
  • AudioPlayerViewModel can now build a playback context from the offline manifest, play downloaded files without a server session, and fall back to the download when the online request fails. Progress is uploaded when online, recorded locally for downloaded books, or queued offline when the server is unreachable.
  • Audiobook downloads only appear for books with exactly one audio part; the detail page's speed menu is replaced by this download control.
  • mergeProgress preserves a local seed written during an in-flight server read; online context loading reconciles unsent local progress with the server before choosing a resume position.
  • Behavioral Change: AudioPlaybackTrack.version is now optional (nil for downloaded files), audiobook records are excluded from movie records and series groups, and the detail Resume action no longer forwards a position to startPlayback.

Macroscope summarized 4acc583.

A book stored as one file gets Download on its detail page (iPhone, iPad,
Mac). The downloaded file plays from the device online and offline, and
listening done offline reaches the server once it is reachable again.

- Detail page: Download in the action row for single-file books, always
  the original file. The server keeps one download per book per device, so
  books split into several files aren't offered. Speed moves out of the
  row; it stays in the player.
- Downloads: books list as their own rows with an Audiobooks storage
  bucket; the offline page plays them in the audio player.
- Player: a downloaded part loads from disk with no server session and
  streams instead if the file won't open. With the server unreachable the
  book opens from its download.
- Progress: offline positions are queued with their sample time and sent
  when the server is reachable again; unsent local listening wins over the
  server's older resume point at start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Nov 15, 2026
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 98 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3ad7d68d-ae7a-4974-b6d1-34c0a9902b3f
Commits

Reviewing files that changed from the base of the PR and between 4999189 and 4acc583.

Files selected for processing: 15

  • iosApp/Tests/AudiobookProgressTests.swift
  • iosApp/Tests/DownloadGroupingTests.swift
  • iosApp/Tests/WatchStateV2Tests.swift
  • iosApp/iosApp/Downloads/DownloadActionButton.swift
  • iosApp/iosApp/Downloads/DownloadGrouping.swift
  • iosApp/iosApp/Downloads/DownloadManager.swift
  • iosApp/iosApp/Downloads/DownloadModels.swift
  • iosApp/iosApp/Downloads/DownloadsView.swift
  • iosApp/iosApp/Downloads/Views/DownloadManagerRows.swift
  • iosApp/iosApp/Downloads/Views/DownloadsManagerComponents.swift
  • iosApp/iosApp/Downloads/Views/OfflineBrowse.swift
  • iosApp/iosApp/Screens/Audio/AudioPlayerViewModel.swift
  • iosApp/iosApp/Screens/Audio/AudiobookPlaybackContext.swift
  • iosApp/iosApp/Screens/Detail/AudiobookDetailContent.swift
  • iosApp/iosApp/Screens/Detail/AudiobookProgress.swift
Walkthrough

The iOS app adds audiobook downloads, includes downloaded audiobooks in the library, and supports offline playback from local files. It also records audiobook progress locally and synchronizes it with the server.

Changes: Audiobook downloads and offline playback

Layer / File(s) Summary
Audiobook download setup
iosApp/iosApp/Downloads/DownloadModels.swift, iosApp/iosApp/Screens/Detail/AudiobookDetailContent.swift, iosApp/iosApp/Downloads/DownloadActionButton.swift, iosApp/iosApp/Downloads/DownloadManager.swift
Download records identify audiobooks. Detail pages offer downloads for single-file books, and the download manager creates audiobook records with author and resume metadata.
Downloaded library and offline details
iosApp/iosApp/Downloads/DownloadGrouping.swift, iosApp/iosApp/Downloads/DownloadManager.swift, iosApp/iosApp/Downloads/DownloadsView.swift, iosApp/iosApp/Downloads/Views/DownloadManagerRows.swift, iosApp/iosApp/Downloads/Views/DownloadsManagerComponents.swift, iosApp/iosApp/Downloads/Views/OfflineBrowse.swift, iosApp/Tests/DownloadGroupingTests.swift
Audiobooks appear in download lists and storage totals, are excluded from series groups, and use audiobook artwork and metadata in download views.
Offline audiobook playback
iosApp/iosApp/Downloads/Views/OfflineBrowse.swift, iosApp/iosApp/Screens/Audio/AudiobookPlaybackContext.swift, iosApp/iosApp/Screens/Audio/AudioPlayerViewModel.swift, iosApp/Tests/AudiobookProgressTests.swift
Offline audiobook details start playback through the audio player. The player builds context from a download manifest and can load the local audio file without creating a server playback session.
Offline progress recording and synchronization
iosApp/iosApp/Downloads/DownloadManager.swift, iosApp/iosApp/Screens/Audio/AudioPlayerViewModel.swift
Progress updates include owner and sample-time checks. The player records local progress and queues or synchronizes updates based on network availability and upload results.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant OfflineBrowse
  participant AudioPlaybackStore
  participant AudioPlayerViewModel
  participant DownloadManager
  participant AudioEngine
  OfflineBrowse->>AudioPlaybackStore: Start audiobook with content ID and preview
  AudioPlaybackStore->>AudioPlayerViewModel: Start playback
  AudioPlayerViewModel->>DownloadManager: Find playable download and read manifest
  DownloadManager-->>AudioPlayerViewModel: Provide download record and manifest
  AudioPlayerViewModel->>AudioEngine: Load downloaded audio file
Loading

Possibly related issues

  • Silo-Server/silo-apple issue 339: The issue covers audiobook progress, resume, chapters, and playback speed. This change adds progress reconciliation, offline playback context with chapter ordering, and replaces the detail-page speed menu with download controls.
  • Silo-Server/silo-apple issue 319: The issue covers downloads and offline use. This change adds audiobook downloads and playback from downloaded files.

Suggested reviewers: rhainland, zzebrahz

Merge Risk: Moderate · previous review 49991

Downloaded audiobooks can occasionally resume from a stale position, or a periodic progress save can attach the wrong book's position when the user switches books quickly. These issues are bounded but should be fixed before merge.

Security architecture risk: Moderate · up to 49991

A playback start racing a profile, account, or server switch may open a book cached for the previous identity. Download creation and queued progress have ownership checks, but the new local audio opening path does not enforce the same boundary. Whether navigation always prevents this race remains unresolved.

Retained concerns

  • Medium · security · inferred: The new offline audiobook opener is not bound to the download scope. During a profile, account, or server switch, the previous store can remain installed while loadedScope is nil. playableDownload still returns its records, and localFileURL opens files from that installed store without validating a playback owner. The detail-error fallback also accepts authorization-related failures unless they are cancellations. A start that reaches this window may therefore play the previous identity’s downloaded book instead of respecting the new identity’s access decision. The previous audio path required online detail and server playback negotiation; local opening is new. End-to-end navigation gating remains unresolved, so the exposure is inferred rather than reproduced.
Security review details

Security Blast Radius

  • inferred — The retained concern is limited to previously downloaded audiobook content on a shared installation during an identity transition. It does not establish arbitrary filesystem access, remote code execution, or increased server privileges.

Security Findings and Attack Paths

  • inferred — A possible path is an audiobook start during replacement of the download scope: the prior scope’s record remains selectable, an online detail failure takes the local fallback, and the file opens without a current playback-owner check. Confirming that starts cannot reach this interval would materially change the assessment.

Trust Boundaries and Controls

  • observed — Progress-owner checks reject local and queued writes after their download scope changes. The progress transport also validates captured profile identity and applies an owner fence. These controls protect progress dispatch but do not validate the new local media opening path.

Resilience and Maintainability Implications

  • observed — The reused queue durably claims batches before sending. Definitely unsent or deferred batches return to pending; uncertain dispatches remain held rather than automatically replayed. Replacement events retain separate identities, and stale-scope responses cannot resolve a newer scope’s queue.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(downloads): download audiobooks and play them offline" matches the main change. The changeset adds audiobook downloads, offline progress queuing, and offline playback from local manife…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is clearly related to the changeset. It explains that the Apple apps gain audiobook downloads and offline playback, and it describes the detail page, Downloads tab, player, and progres…
Full details: Title check

Explanation

The title "feat(downloads): download audiobooks and play them offline" matches the main change. The changeset adds audiobook downloads, offline progress queuing, and offline playback from local manifests in the Apple apps.

Full details: Description check

Explanation

The description is clearly related to the changeset. It explains that the Apple apps gain audiobook downloads and offline playback, and it describes the detail page, Downloads tab, player, and progress queueing changes. It also lists validation steps and known risks. The description is not off-topic and is specific enough to pass this lenient check.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-kody

silo-kody Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T00:38:38.746828Z 4acc583 New commits
🔒 Security Review ✅ Completed 2026-11-16T00:42:52.921354Z 4acc583 New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f701e66916

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- A start sends unsent offline listening first (up to 3 s) and then reads
  the server's reconciled resume point; only when the send doesn't land
  does the local position win.
- The shared progress flush belongs to the scope it started in, so a
  flush after a profile or server switch drains that scope's queue.
- Downloading a book seeds its offline resume point from the server's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Nov 15, 2026

Copy link
Copy Markdown

Evidence is incomplete. The private evidence link and PR description identify an iPhone simulator build, but the changed views are shared by iOS and macOS targets (#if !os(tvOS)). They reach iPhone, iPhone Duo folded and open, iPad, and Mac; Apple TV is correctly excluded.

  • Audiobook detail action row (AudiobookDetailContent.swift, DownloadActionButton.swift): the new Download control and removed speed action need captures on iPhone Duo folded and open, iPad, and Mac. The PR explains why before captures were unavailable; that limitation is noted.
  • Downloads list and storage UI (DownloadGrouping.swift, DownloadManager.swift, DownloadsView.swift, DownloadManagerRows.swift, DownloadsManagerComponents.swift): audiobook rows, cover/subtitle presentation, and the Audiobooks storage category need captures on iPhone Duo folded and open, iPad, and Mac.
  • Offline book detail and playback (OfflineBrowse.swift, AudioPlayerViewModel.swift, AudiobookPlaybackContext.swift): the offline detail and downloaded-book playback/resume flow need evidence on iPhone Duo folded and open, iPad, and Mac, including a recording of the multi-step download-to-offline-playback flow.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@macroscopeapp

macroscopeapp Bot commented Nov 15, 2026

Copy link
Copy Markdown

Visible UI and playback changes are not fully evidenced across the affected devices.

  • AudiobookDetailContent.swift, DownloadsView.swift, DownloadManagerRows.swift, DownloadsManagerComponents.swift, and OfflineBrowse.swift: the Evidence section identifies an iPhone simulator capture, but says iPhone Duo (folded and open), iPad, and Mac were not captured. The shared views use different width- and platform-specific layouts, so the linked page should show the new detail action row and audiobook/download screens on those devices. The reason the before-capture was unavailable is documented; it remains unavailable rather than passing.
  • AudioPlayerViewModel.swift: offline audiobook playback and progress sync are a multi-step, user-noticeable flow. The linked page should show a recording of download, offline playback/resume, and reconnect progress sync on iPhone, iPhone Duo (folded and open), iPad, and Mac. Apple TV need not be included because the app has no audiobook download path there.

Suggested fix: No diff — add the missing device captures and flow recording to the linked evidence page.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

…ress

The start-time send now reports whether the server applied the book's
queued position, instead of inferring it from an empty queue:
- a rejected, refused or deferred send leaves the local position winning,
  and the start stops waiting as soon as the flush ends;
- a send that lands after the 3 s wait, while the detail is on its way,
  reads the detail again so newer progress from elsewhere wins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

On the evidence comments: the published page covers the iPhone flow end to end against a real server (download, playback from the device while online, offline playback, and the offline position reaching the server on reconnect, checked against the server's progress row). The detail page, Downloads list and offline page are the same SwiftUI views on iPad, iPhone Duo and Mac (#if !os(tvOS), no size-class branches added). Those devices weren't captured because the test server started answering 410 on GET /api/v1/auth/setup partway through (Silo-Server/silo-server#3200), and the app's sign-in still calls it, so no fresh build could sign in. The PR body's Evidence and Risks sections say so. Apple TV has no downloads.

🤖 Claude Code (claude-opus-5-5)

@macroscopeapp

macroscopeapp Bot commented Nov 15, 2026

Copy link
Copy Markdown

The latest progress-reconciliation change in AudioPlayerViewModel.swift can change where and when downloaded audiobook playback resumes after reconnect. The Evidence section describes an iPhone simulator test, but no recording of this updated multi-step flow; add one showing offline playback, reconnect, and the resulting resume position on iPhone, iPhone Duo folded and open, iPad, and Mac. The section says the Duo, iPad, and Mac were not captured.

Suggested fix: No diff — add the recording to the linked evidence page.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4999189eee

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…lts by scope

- The player captures the download scope at every start and decides at
  each save whether the book is downloaded, so a download that finishes
  while listening keeps the offline resume point current from then on.
- syncUnsentProgress reports nothing applied when the scope changed while
  it waited, so another profile's answer can't stand in for this one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Nitpick comments: 1

iosApp/Tests/DownloadGroupingTests.swift: 1

105-106: Trivial · Maintainability & Code Quality · Quick win

Exercise grouping with a retained audiobook series ID.

The factory initializes book.seriesId to nil, and the preceding assertions confirm that it stays nil. Thus, this grouping assertion still passes if the audiobook exclusion is removed from seriesGroups.

Keep the manifest assertions. Add a separate grouping case that explicitly sets an audiobook's seriesId before grouping. This protects the new filter independently of manifest hydration.

As per coding guidelines, “Add focused regression tests when they meaningfully protect changed behavior.”

Source: Coding guidelines

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0793dfdb-e2f1-4996-b01b-45c4dab72294
Commits

Reviewing files that changed from the base of the PR and between 484d823 and 4999189.

Files selected for processing: 14

  • iosApp/Tests/AudiobookProgressTests.swift
  • iosApp/Tests/DownloadGroupingTests.swift
  • iosApp/iosApp/Downloads/DownloadActionButton.swift
  • iosApp/iosApp/Downloads/DownloadGrouping.swift
  • iosApp/iosApp/Downloads/DownloadManager.swift
  • iosApp/iosApp/Downloads/DownloadModels.swift
  • iosApp/iosApp/Downloads/DownloadsView.swift
  • iosApp/iosApp/Downloads/Views/DownloadManagerRows.swift
  • iosApp/iosApp/Downloads/Views/DownloadsManagerComponents.swift
  • iosApp/iosApp/Downloads/Views/OfflineBrowse.swift
  • iosApp/iosApp/Screens/Audio/AudioPlayerViewModel.swift
  • iosApp/iosApp/Screens/Audio/AudiobookPlaybackContext.swift
  • iosApp/iosApp/Screens/Detail/AudiobookDetailContent.swift
  • iosApp/iosApp/Screens/Detail/AudiobookProgress.swift

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

…ore the store loads

A book started while the download store was still loading had no scope
owner for the whole session. The player now takes the scope at the first
save after the store has loaded; a profile or server switch closes the
player, so it is still the scope playback started in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

…iting

- syncNow captures the book, position, duration, sample time, download
  scope and request identity before the session-progress request, and the
  whole-book upload uses that identity (syncProgress(_:auth:)), so a newer
  start or a profile switch can't mix into the sample.
- syncUnsentProgress reports a book applied only when no newer position
  for it is still unsent.
- A download's seeded resume point is dated as old as possible, so the
  next progress read replaces it with the server's.
- The grouping test gives the book a series id, so it fails without the
  audiobook exclusion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

…date seeds at detail load

- The audio player captures the request identity when a book starts and
  uploads whole-book progress only under it. An explicit profile switch
  doesn't close the player, so a book left playing is now refused instead
  of writing into the newly selected profile.
- A download's seeded resume point is dated when the detail reporting it
  arrived: a newer save elsewhere still replaces it, and an older progress
  read that was already in flight doesn't.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. and removed size/XL 500–999 added + deleted lines (all files); change volume, not priority. labels Nov 16, 2026
@silo-kody

silo-kody Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

A downloaded book's seeded resume point no longer carries a client-made
date. It is dated distantPast and marked with the device time it was
written (LocalProgressEntry.seededAt): a progress read already in flight
leaves it, and the next read that starts after it replaces it with the
server's row. No device time is compared with a server time, and a cached
or delayed detail can't make a stale position look fresh.

The audio player takes a late download scope only for the profile it
started under, since an explicit profile switch keeps the player going.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: P2 Limited scope, workaround exists, or polish size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant