fix(offline): show every track of server-prepared downloads - #550
Conversation
Server-prepared (remux/transcode) downloads now carry every audio track and embedded subtitle. Label their audio from the offline manifest, ignore the MP4 muxer's default flag on subtitle tracks, classify sup sidecars as PGS, show sidecar titles, and fall back to the file's default track when a saved audio position is out of range.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedNext included review available in 47 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughOffline playback now identifies server-prepared files, applies manifest metadata to prepared audio and subtitle inventories, resolves audio ordinals against probed streams, and recognizes ChangesOffline track playback
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant OfflineManifest
participant OfflinePlayback
participant PlayerViewModel
participant AetherLoadSpec
participant OfflinePreparedTrackInventory
OfflineManifest->>OfflinePlayback: Provide prepared-file status and subtitle metadata
OfflinePlayback->>PlayerViewModel: Provide prepared playback context
PlayerViewModel->>AetherLoadSpec: Resolve manifest audio ordinal against probed IDs
AetherLoadSpec-->>PlayerViewModel: Return stream ID or nil
PlayerViewModel->>OfflinePreparedTrackInventory: Adjust prepared-file track inventory
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No identified playback issue currently blocks merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changes remain within offline playback and do not appear to add network access or privileges. The main remaining uncertainty is whether every server-prepared manifest lists audio tracks in the same order as the downloaded file. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| return track.replacing( | ||
| title: hasSynthesizedName(track) ? nil : track.title, | ||
| isDefault: false | ||
| ) |
There was a problem hiding this comment.
Unwanted subtitle playback persists because clearing isDefault does not undo Aether's muxer-default selection: when the offline manifest has no subtitle policy, the auto-resolver returns .noChange and adoptAetherInventory retains engine.activeSubtitleTrackIndex. Clear the engine's selection after the offline load when there is no explicit or automatic subtitle choice, before publishing the inventory.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
There was a problem hiding this comment.
This doesn't happen. AetherEngine only activates a subtitle at load through LoadOptions.preferredSubtitleLanguages (AetherEngine+Subtitles.swift, the preferred-subtitle auto-select); a container's default disposition never selects one. Offline loads with no subtitle preference leave activeSubtitleTrackIndex nil, so adoptAetherInventory has nothing to keep. testMuxerDefaultDoesNotEnableSubtitlesOffline covers the resolver side. On an iOS simulator, prepared downloads whose first MP4 subtitle carries the muxer default started with subtitles off during cue windows. Clearing isDefault here only keeps the menu and later preference resolution from treating that flag as intent.
There was a problem hiding this comment.
You’re right. I conflated the muxer’s default disposition with subtitle activation. On an offline load without a preferred subtitle language, activeSubtitleTrackIndex remains nil, so the default flag does not turn subtitles on. The resolver test and simulator check support that distinction. Clearing isDefault here prevents the flag from being treated as intent in the menu or later preference resolution. I withdraw that concern.
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Problem
Related issue: Silo-Server/silo-server#1167
Validation tasks: changes #319 C1
Server-prepared downloads (remux or transcode) used to contain one audio track and no subtitles. With Silo-Server/silo-server#1681 they carry every audio track, keep SRT/WebVTT subtitles inside the MP4, and list ASS/SSA and PGS tracks as sidecar files in the offline manifest. On iOS those files played, but the audio menu showed generic names, the first subtitle track looked like a default, and PGS sidecars weren't recognised as bitmap subtitles.
Platforms: iOS and macOS, which share the offline download code. tvOS has no downloads.
Approach
supsidecars are classified, ranked and labelled as PGS. Sidecars show the manifest's track title, so "Full" and "Signs & Songs" ASS tracks are distinguishable.Original and older prepared downloads behave as before, apart from the
supclassification and the audio fallback.Validation
xcodebuild teston an iPhone 17 Pro simulator: 2221 tests, 0 failures, 2 skipped.Risks
Behaviour only changes when the manifest describes a server-prepared file. Requires the server PR for the extra tracks and sidecars; against an older server, downloads look as they did before.
Checklist
AI Disclosure
Note
Fix offline player to show every track of server-prepared downloads
originaldelivery format) are now detected viaOfflineManifest.isServerPreparedFilein DownloadModels.swift and carried through playback into the player.OfflinePreparedTrackInventoryin OfflinePreparedTrackInventory.swift replaces MP4-muxer synthesized audio names with manifest titles and languages when audio counts match, and clears synthesized titles and default flags from embedded timed-text tracks.hearingImpairedflag; the classifier in SubtitleCodecClassifier.swift now treatssupas a bitmap (PGS) codec, including for display ordering and formatting.invalidAudioTrackIndex.audioTracksin OfflinePreparedTrackInventory.swift for mismatch handling regressions.Macroscope summarized 35c698a.