Repository navigation
Description
Silo-Server/silo-server#1880 lets season, series, and monitored-series downloads use a bitrate preset instead of always coming in original quality. It also reports how far along the server is with each download it still has to prepare. The iOS client ships all of it in Silo-Server/silo-apple#597. The phone app is behind on four points:
- A series download is forced to Original (
DownloadEnqueuer.startSeries), and the UI has no season download.startSeasonexists but nothing calls it. - Monitors are local only.
DownloadSubscriptionlives in Room andDownloadSubscriptionWorkerevaluates it on the device. Nothing uses the server's monitor API, and no screen creates a monitor, soMonitoredDownloadsCardstays empty. - A preparing download shows "Preparing…" with no queue position or progress, and nothing re-reads the list.
DownloadWorkerretries/fileon409every 30 seconds for 30 attempts and then fails the download. A bitrate season queues one encode per episode and the server runs 2 at a time by default, so later episodes can wait longer than that. - The quality picker only appears for a single download.
Android TV has no downloads today, so this issue covers the phone app.
What the server adds
All of it is additive and gated by flags on GET /api/v2/capabilities/downloads. The contract is docs/downloads-api.md in silo-server, §3, §4.1, §4.2, §5, and §8.
-
bulk_quality:POST /api/v2/downloadswithseries: trueaccepts any value inquality_presets. Addseason_numberfor one season.- The server resolves the preset per episode. Prepared episodes start
preparing. - An episode the preset can't be prepared for, such as a 4K source when 4K transcoding is off, is listed in
skippedwith the new reasonquality_unavailable. The rest of the batch still registers. - Keep
qualityunchanged while followingpage.next_cursor. - Without the flag, send
original. Anything else gets501 bulk_quality_unavailable.
- The server resolves the preset per episode. Prepared episodes start
-
monitor_quality: monitors (/api/v2/downloads/subscriptions, §8) gain aqualityfield, defaultoriginal, on create,PATCH, and every read.- New episodes register in the monitor's quality. Downloads already registered keep theirs.
- The server checks a changed quality against the account's transcode permission. A quality sent unchanged isn't re-checked.
- Without the flag, the field is absent and monitors download originals.
-
preparation_progress: eachpreparingentry inGET /api/v2/downloadscarriespreparation:state:queued,running,retrying(waiting out a retry backoff), orpaused(an administrator paused it, feat(downloads): let admins pause, resume, and cancel download preparation silo-server#1925).queue_position: whilequeued, the 1-based place among every queued job on the server.progress(0 to 1) andremaining_seconds: whilerunning, once the encode reports them.
preparationis absent when progress can't be read; show a plain preparing state then. Each server node refreshes these values at most every 5 seconds.
Monitors themselves predate #1880: create, list, PATCH/DELETE with If-Match, and bounded sync, gated by series_monitoring, subscription_reads, subscription_mutations, and bounded_subscription_sync. They are device-scoped.
Work
Capability and models:
- Decode
bulk_quality,monitor_quality,preparation_progress,subscription_reads,subscription_mutations, andbounded_subscription_synconDownloadCapability. Decodepreparationon the download entry,qualityon the server monitor, and thequality_unavailableskip reason. An unknownpreparation.statemust still decode and show as a plain preparing state.
Season and series downloads:
- Add a season download, sent as one
series: truebatch withseason_number, in place of the per-episode loop instartSeason. - Offer the quality picker for season and series downloads when
bulk_qualityis set, starting from the default in Settings.- Without the flag, show Original only, with "This server downloads seasons in original quality."
- At a bitrate, add "Episodes the server can't convert to this quality are skipped."
- Tell the user about
skippedepisodes rather than dropping them silently (see Download series fails silently when the server rejects the batch #424).
- Handle
429 rate_limitedon a batch. The server checks a season against the account's concurrent download limit as a whole, and prepared rows count toward it until they're ready. With the default limit of 3, an 8-episode season is refused outright.
Monitors on the server:
- Replace the Room monitors with server monitors when
subscription_mutationsis set:- Create, edit, pause, and stop through
/api/v2/downloads/subscriptions. - Call
POST /api/v2/downloads/subscriptions/syncafter a create, resume, or widening edit, on app open, and from the periodic worker. Followpage.next_cursoruntilpage.has_moreis false. - Then re-read
GET /api/v2/downloadsand enqueue the newly registered rows. - Enforce
delete_watchedandmax_storage_byteson the device (§11.8). - Decide what happens to existing Room monitors: migrate the series ones, or drop them, since users can't create them today.
- Create, edit, pause, and stop through
- Offer a quality on create and edit when
monitor_qualityis set.- Prefill an existing monitor's stored quality, even if it's no longer in
quality_presets. - On
PATCH, sendqualityonly when it changed, and leave out an unchangedmode. The server re-validates whatever it receives, so resending stored values can fail after a permission change.
- Prefill an existing monitor's stored quality, even if it's no longer in
- Never offer a quality the server doesn't list. When
quality_presetschanges after a profile switch or permission change, reset a one-time or new-monitor choice to the Settings default.
Preparation progress:
- Show
preparationon each preparing row in the Downloads tab and on the item page, with the iOS wording:queued: "Waiting to prepare · next in line" or "Waiting to prepare · 3rd in line". Without a position: "Waiting to prepare".running: "Preparing · 35% · 6 min left" with a progress ring. Under a minute: "under a minute left". Over an hour: "1 hr 5 min left". Before progress arrives: "Preparing on server…".retrying: "Preparing · trying again soon".paused: "Preparation paused on the server".
- While any download is preparing, re-read
GET /api/v2/downloadsevery 15 seconds and stop when none is. iOS does this app-wide; the same read moves rows toready. - Expect progress to arrive in bursts. On a source with many subtitle tracks, a running encode can report the same fraction for minutes while
remaining_secondsgrows, then jump. Don't read a frozen value as a failure. - Don't fail a download because its file is still preparing. Wait for the listed status to reach
readyorfailedinstead of giving up after a fixed number of/fileretries. - Give rows that a monitor sync registered a title before their file is ready. They have no local sidecar. iOS reads their offline manifests (§4.6), at most 4 at a time, as soon as they're listed, and retries failures with backoff from 15 seconds to 5 minutes.
UI, following iOS:
- Replace the series page's "Download episode / Download series" menu with one Download action that opens a sheet with two tabs:
- One Time: this episode, this season, or all episodes, plus Quality.
- Monitor: All Episodes, Future Episodes, or Last Season (only modes in
monitoring_modes), plus Quality, Delete after watching, and Storage limit. The button reads "Start Monitoring", or "Save" for an existing monitor, which also offers Stop Monitoring. Keep an existing monitor's rule listed even if the server stops advertising it, and keep the storage limit in bytes so a limit another client wrote survives an edit.
- Show a banner on a monitored series' page with the monitor's status, for example "Preparing Episode 1 · Future episodes · 2 Mbps".
- Replace
MonitoredDownloadsCardwith a Monitored row in the Downloads tab that opens the list of monitored series. Each shows its rule, quality, and status: paused, at its storage limit, downloading, waiting and why, next episode and air date, up to date, or "Monitoring" when the airing calendar hasn't loaded and nothing is in flight. - Settings: the quality footer says the setting is the default for every download and monitor and that the Download sheet can change it. When only
bulk_qualityis set, it says monitors download originals. - Tests: decoding with and without each flag and field, the status-line wording, resetting a quality the server no longer lists, not sending an unchanged monitor quality or rule, and monitor sync paging.
References
- Server: feat(downloads): let season downloads and series monitors choose a quality silo-server#1880 (season and monitor quality, preparation progress), feat(downloads): let admins pause, resume, and cancel download preparation silo-server#1925 (pausing preparation).
- iOS: feat(downloads): show monitored series and simplify the series Download sheet silo-apple#597.
- Download limits: [bug] Download series always fails with 429 when the series has more episodes than the concurrent download limit silo-server#1703, fix(downloads): let a series download start with one free slot silo-server#1704, fix(downloads): queue season and series downloads over the concurrent limit silo-server#1713.
- Android: Download series fails silently when the server rejects the batch #424 (a series download failing silently), Downloads / offline — Android #329 (downloads validation).
The evidence page has the iOS screens against a server running #1880: the Download sheet with season and monitor quality, the limit error, preparing rows with queue positions, progress and a paused job, the monitor banner, the Monitored list, and the Settings footer.
AI disclosure
Drafted with Claude Code (claude-opus-5-5[1m]) from the server contract, the iOS implementation, a read of silo-android main at 844ff74, and the captures on the evidence page.
Activity