Skip to content

feat(downloads): let admins pause, resume, and cancel download preparation - #1925

Merged
Quick104 merged 2 commits into
mainfrom
feat/download-preparation-controls
Oct 4, 2026
Merged

Quick104 merged 2 commits into
mainfrom
feat/download-preparation-controls

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #998
Validation tasks: none

Administrators can watch offline-download preparation jobs on Activity → Download preparation, but they cannot stop them. A queue of 4K-to-720p transcodes holds every prepare slot until each encode finishes or fails, even when nobody needs the result any more. That includes jobs whose downloads were deleted on the device, which keep encoding (#998). The only way out today is to wait or restart the server.

This change lets an administrator pause, resume, and cancel preparation jobs, one row at a time or for a selection.

  • Pause keeps the job's place in the queue but no worker claims it. A running encode stops and starts over when resumed; the stopped attempt does not count against the job's retries. Waiting downloads stay preparing.
  • Resume puts the job back in the queue at its old position, or back to a retry backoff that had not elapsed.
  • Cancel stops the encode, removes the job, and fails every download still waiting on it with "Canceled by an administrator". The user can download again, which starts a new job. Cancel also removes a failed job from the list.

Approach

download_artifacts gets a nullable paused_at. ClaimNext skips paused rows, so pausing needs no new values in the recipe status families (queued, tone_map_queued, audio_v2_queued, tracks_v1_queued).

Stopping a running encode reuses the existing lease fence. Pausing returns the row to its queued status and clears lease_owner, and canceling deletes the row; either way the worker's next heartbeat fails and it aborts FFmpeg, and its MarkReady or MarkFailedOrRetry write is rejected. On the replica that handled the request the encode is canceled at once through an in-process registry of running attempts. On another replica it stops at its next heartbeat, within about 40 seconds. A paused job keeps an unowned lease_expires_at one lease length (two minutes) ahead that ClaimNext waits out, so a quick resume cannot start a second attempt on the same local output path while the first may still run.

Cancel needs two more guards. New jobs write to a path that includes the job id, so a job created after a cancel never shares a file with the canceled encode, and a local encode that finishes after its row was deleted removes its file. Remote attempts already go through the orphan cleanup queue, which treats a locator whose row is gone as abandoned. A download linked to a job while the cancel commits fails with the same message, when ConfirmArtifactLink runs or at the next queue reconciliation, so it cannot wait in preparing forever.

The v2 admin API adds POST /api/v2/admin/downloads/preparations/pause, /resume, and /cancel. Each takes {"ids": [...]} (up to 500) and returns one outcome per distinct id: applied, unchanged, not_found, or not_applicable. The list gains a paused state with paused_at, counts.paused, and the capability document gains controls. Each action publishes the existing download_preparation.changed event, and cancel publishes the usual download user-state event for each failed download. The web Activity tab adds row actions, checkbox selection with a bulk bar, and a confirmation before cancel that says how many waiting downloads will fail.

Validation

  • Go: new Postgres tests for pause, resume, and cancel (outcomes, fencing of the stopped worker, refunded attempt, claim grace, failed downloads, a download linked to a canceled job) and the immediate local abort; go test for internal/downloads, internal/apiv2, internal/api, internal/contractledger, internal/contractspec pass apart from two tests that also fail on main locally (TestAdminResourceCapabilitiesAndScope on macOS, TestManagedCreateAbsenceRacePostgres). The new DB tests are listed in scripts/ci/db-contracts.txt.
  • Contracts: verify-apiv2-openapi, verify-apiv2-fixtures, verify-apiv2-web-types, verify-route-inventory, and verify-migration-ledger pass. verify-apiv2-contract passes with the approval in breaking-approvals.json (see Risks).
  • make lint-changed: 0 issues. Web: tsc -b, eslint (no errors), prettier, and the Activity and preparation vitest suites pass.
  • Manual, on a local single-node server with real FFmpeg encodes: pausing a running encode ended its FFmpeg process within 100 ms and the next queued job started; cancel removed the job and failed its download with the expected message; a job paused mid-encode and resumed at once read as queued and started again after the grace. The fixes from review (two-minute grace, per-job output paths, the canceled-link repair, filtered bulk selection) are covered by tests and were not re-run by hand. make verify-local-paths crashes on macOS in files this change does not touch; the diff was checked for local paths by hand.

Evidence: https://evidence.siloserver.org/r/silo-server/download-prep-controls/

Risks

  • Migration: one nullable column, no backfill.
  • API: state on the preparation list gains the value paused, which the contract check counts as breaking. Only the web admin reads this endpoint (silo-apple and silo-android do not), and this change teaches it the value. The approval is recorded in contracts/api/v2/breaking-approvals.json.
  • Rolling upgrade: an API replica running the previous build does not check paused_at and can still claim a paused job until it is upgraded.
  • Output paths: new jobs get file names that include the job id. Existing rows keep their stored paths.
  • Canceling is irreversible for the waiting downloads: they fail on the requesting devices and have to be downloaded again.
  • This does not stop encodes whose downloads were all deleted ([bug] Orphaned download artifacts keep transcoding after their downloads are deleted #998); an administrator can now cancel them.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: A separate Claude Code review agent (claude-opus-5-5) read the diff against the encode queue's lease, recovery, and download-linking paths and the web panel state. It found that a download created while its job was being canceled could stay preparing forever, that a canceled encode on another replica could share an output file with a re-requested job or leave its file behind, a stop grace shorter than the lease, a gap in the local attempt registry, and bulk actions that reached rows hidden by filters. All of these were fixed and tested. Its remaining finding, older replicas claiming paused jobs during a rolling upgrade, is listed under Risks.

🤖 Generated with Claude Code

Note

Add admin pause, resume, and cancel endpoints for download preparations

  • Adds POST /api/v2/admin/downloads/preparations/pause, /resume, and /cancel routes in admin_download_preparations.go. Each accepts 1-500 preparation IDs and returns per-ID outcomes (applied, unchanged, not_found, not_applicable).
  • Pause is implemented as an atomic row-locked update in preparation_controls.go: it converts running jobs back to queued, refunds the attempt, clears worker state, and sets a temporary unowned lease so stopped workers cannot re-claim during a grace period. Local running encode attempts are canceled through the artifact manager.
  • Adds a nullable paused_at column on download_artifacts in 20261004050341_add_download_artifact_paused_at.sql, plus paused state, counts, and ordering in preparation listings.
  • The admin panel in AdminDownloadPreparationsPanel.tsx gains row and bulk pause/resume/cancel actions, paused-state rendering, and a confirmation dialog that warns about lost encoding progress and waiting downloads.
  • Output paths now include the artifact ID (artifact.go) so different artifacts with identical parameters no longer collide, and orphaned preparing downloads are failed with a canceled message (repo.go).
  • Behavioral Change: ClaimNext no longer claims paused or lease-grace-period jobs; the list-preparations response adds a paused enum value (approved in breaking-approvals.json); existing artifact output paths change because of the new ID component.

Macroscope summarized 459aa9d.

…ation

Administrators could watch offline-download preparation jobs but not stop
them, so a queue of long transcodes held every prepare slot until each one
finished, including jobs nobody was waiting for any more.

Pause keeps a job's queue position but hides it from ClaimNext through a
new paused_at column; a running encode is fenced out through its lease and
stopped at once on the replica that took the request. Resume clears the
pause. Cancel deletes the job and fails the downloads still waiting on it
with "Canceled by an administrator". The v2 admin API adds pause, resume,
and cancel operations with per-job outcomes, and the web Activity tab adds
row actions, bulk selection, and a cancel confirmation.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 4, 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 Oct 4, 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-10-04T18:12:10.388417Z 2b1e033 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.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbd383a4-b671-4acf-927e-1da9a8909b8d
📥 Commits

Reviewing files that changed from the base of the PR and between cc4125d and 459aa9d.

📒 Files selected for processing (39)
  • contracts/api/v2/breaking-approvals.json
  • contracts/api/v2/fixtures/admin_download_preparation_capabilities.json
  • contracts/api/v2/fixtures/admin_download_preparations.json
  • contracts/api/v2/fixtures/cancel_admin_download_preparations.json
  • contracts/api/v2/fixtures/cancel_admin_download_preparations_invalid_id.json
  • contracts/api/v2/fixtures/index.json
  • contracts/api/v2/fixtures/pause_admin_download_preparations.json
  • contracts/api/v2/fixtures/resume_admin_download_preparations.json
  • contracts/api/v2/openapi.json
  • docs/admin-api.md
  • docs/downloads-api.md
  • internal/api/router.go
  • internal/api/testdata/media_routes.txt
  • internal/apiv2/admin_download_preparations.go
  • internal/apiv2/admin_download_preparations_test.go
  • internal/apiv2/fixtures_test.go
  • internal/apiv2/router.go
  • internal/contractledger/ledger_test.go
  • internal/downloads/artifact.go
  • internal/downloads/artifact_repo.go
  • internal/downloads/artifact_test.go
  • internal/downloads/artifacts.go
  • internal/downloads/preparation_controls.go
  • internal/downloads/preparation_controls_test.go
  • internal/downloads/preparations.go
  • internal/downloads/repo.go
  • migrations/sql/20261004050341_add_download_artifact_paused_at.sql
  • scripts/ci/db-contracts.txt
  • web/src/api/v2/adminDownloadPreparations.ts
  • web/src/api/v2/operations.ts
  • web/src/api/v2/schema.ts
  • web/src/components/ServerActivity.tsx
  • web/src/hooks/queries/admin/downloadPreparations.ts
  • web/src/pages/AdminActivity.test.tsx
  • web/src/pages/AdminActivity.tsx
  • web/src/pages/AdminDownloadPreparationsPanel.tsx
  • web/src/pages/adminDownloadPreparationPresentation.test.ts
  • web/src/pages/adminDownloadPreparationPresentation.ts
  • web/src/test/downloadPreparations.ts
 ___________________________________
< I like big bugs and I cannot lie. >
 -----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Quick104
Quick104 merged commit cb5322e into main Oct 4, 2026
3 of 4 checks passed
@Quick104
Quick104 deleted the feat/download-preparation-controls branch October 4, 2026 18:10
Comment on lines +50 to +55
const results: AdminDownloadPreparationActionResult[] = [];
for (let start = 0; start < ids.length; start += ADMIN_DOWNLOAD_PREPARATION_ACTION_MAX_IDS) {
const response = await v2(ACTION_OPERATIONS[action], {
profileContext: context,
body: { ids: ids.slice(start, start + ADMIN_DOWNLOAD_PREPARATION_ACTION_MAX_IDS) },
retryAuthentication: false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug medium

runAdminDownloadPreparationAction batches the caller's IDs without removing duplicates across chunk boundaries, so a job ID repeated before and after the 500-ID boundary is processed twice, producing duplicate results, incorrect action counts, and a possible unchanged result while violating the one-result-per-distinct-ID client API contract. Deduplicate IDs before chunking while preserving first-occurrence order.

const unique = [...new Set(ids)];
const results: AdminDownloadPreparationActionResult[] = [];
for (let start = 0; start < unique.length; start += ADMIN_DOWNLOAD_PREPARATION_ACTION_MAX_IDS) {
  const response = await v2(ACTION_OPERATIONS[action], {
    profileContext: context,
    body: { ids: unique.slice(start, start + ADMIN_DOWNLOAD_PREPARATION_ACTION_MAX_IDS) },
    retryAuthentication: false,
  });
  results.push(...response.results);
}
Prompt for LLM

File web/src/api/v2/adminDownloadPreparations.ts:

Line 50 to 55:

`runAdminDownloadPreparationAction` batches the caller's IDs without removing duplicates across chunk boundaries, so a job ID repeated before and after the 500-ID boundary is processed twice, producing duplicate results, incorrect action counts, and a possible `unchanged` result while violating the one-result-per-distinct-ID client API contract. Deduplicate IDs before chunking while preserving first-occurrence order.

Suggested Code:

  const unique = [...new Set(ids)];
  const results: AdminDownloadPreparationActionResult[] = [];
  for (let start = 0; start < unique.length; start += ADMIN_DOWNLOAD_PREPARATION_ACTION_MAX_IDS) {
    const response = await v2(ACTION_OPERATIONS[action], {
      profileContext: context,
      body: { ids: unique.slice(start, start + ADMIN_DOWNLOAD_PREPARATION_ACTION_MAX_IDS) },
      retryAuthentication: false,
    });
    results.push(...response.results);
  }

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Quick104 added a commit that referenced this pull request Oct 4, 2026
Integrates #1925: a preparation an administrator paused is reported to the
device with state "paused" (added to the preparation state enum and the
downloads API doc) and is not counted in queue positions.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Comment on lines 307 to +310
running={runningPreparations}
queued={preparationCounts.queued}
retrying={preparationCounts.retrying}
paused={preparationCounts.paused}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug high

The server-activity empty-state calculation excludes paused preparations even though the new summary receives and displays a paused count, so totalActive remains zero when all preparation jobs are paused and there are no recent failures, hiding the preparation section and the jobs administrators need to resume. Include preparationCounts.paused in activePreparations or otherwise include it in the empty-state predicate.

const activePreparations = preparationCounts
  ? preparationCounts.running + preparationCounts.queued + preparationCounts.retrying + preparationCounts.paused
  : 0;
Prompt for LLM

File web/src/components/ServerActivity.tsx:

Line 307 to 310:

The server-activity empty-state calculation excludes paused preparations even though the new summary receives and displays a paused count, so `totalActive` remains zero when all preparation jobs are paused and there are no recent failures, hiding the preparation section and the jobs administrators need to resume. Include `preparationCounts.paused` in `activePreparations` or otherwise include it in the empty-state predicate.

Suggested Code:

const activePreparations = preparationCounts
  ? preparationCounts.running + preparationCounts.queued + preparationCounts.retrying + preparationCounts.paused
  : 0;

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Quick104 added a commit to Silo-Server/silo-apple that referenced this pull request Oct 4, 2026
A preparing download whose server job an administrator paused reads
"Preparation paused on the server" (Silo-Server/silo-server#1925).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Quick104 added a commit that referenced this pull request Oct 4, 2026
Quick104 added a commit that referenced this pull request Oct 4, 2026
…ality (#1880)

* feat(downloads): let season downloads and series monitors choose a quality

- Native season and series batches accept any advertised quality preset,
  resolved per episode; episodes the preset cannot reach are skipped with
  quality_unavailable.
- Monitors store a quality (new column, default original) and register new
  episodes in it, preparing files before the monitor lock and pacing prepared
  episodes to the account's free concurrent download slots.
- The download capability reports bulk_quality and monitor_quality.
- /api/v1 batches stay original-only.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): share free download slots across concurrent monitor syncs

A monitor sync with prepared episodes now holds the account's quota lock
from counting free concurrent download slots until its rows commit, so
monitors of one account syncing at once cannot each claim every free slot.
Quality is still resolved before any lock.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): count prepared replacements and ready files correctly

- A season page that replaces an existing entry with a prepared file does
  so under the quota lock and counts toward the concurrent limit when the
  replacement adds an active download.
- A monitor sync re-reads the monitor before queueing encodes and queues
  none when the monitor was edited or paused since planning.
- An episode whose prepared file is already ready takes no free slot.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): count version changes and refuse stale guards before encoding

- A prepared replacement that switches the episode to another media file
  counts toward the concurrent limit.
- A replacement whose expected revision is stale is refused before its
  encode is queued.
- The monitor PATCH body declares quality's preset enum.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): count prepared replacements by readiness, not the period

- A prepared replacement counts toward the concurrent limit only when its
  entry isn't already active and the target's prepared file isn't ready,
  using the same lookup as monitor pacing.
- The period quota counts only new downloads; a replacement updates its
  entry in place. QuantityLimiter.CheckCounts takes the two counts apart.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(downloads): report preparation progress on listed downloads (#1881)

* feat(downloads): report preparation progress on listed downloads

- GET /api/v2/downloads attaches a preparation object to preparing entries:
  queue state and position, or the running encode's progress and estimated
  time left, ranked the same way as the admin preparation queue.
- The download capability reports preparation_progress.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): count a job whose worker lease expired as queued

A running prepare job whose lease expired is claimable again, so the
preparation view now reports it as queued, with a queue position and
without its stale progress. Both the device-facing preparation object and
the admin preparation queue use this classification.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): claim prepare jobs in the order the queue position reports

ClaimNext now breaks created_at ties by id, the same order the reported
queue position uses.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* perf(downloads): share one preparation queue snapshot per node

Ranking the preparation queue covers every unfinished job on the server,
so download list reads now share one snapshot per node, refreshed at most
every 5 seconds, instead of ranking the queue on each request. Concurrent
readers wait for a single refresh.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): stop reporting encode progress once samples stop arriving

A running encode's progress and estimate are reported only while its worker
marks progress available and the last sample is under 30 seconds old (six
flush intervals). A worker whose reports stopped no longer shows a frozen
percentage.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): share a failed preparation refresh among waiting readers

When the queue ranking fails, readers waiting on that refresh now get an
empty snapshot for the snapshot TTL instead of each repeating the failing
query.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

* chore(api): drop the breaking-change approval consumed by #1925

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Quick104 added a commit to Silo-Server/silo-apple that referenced this pull request Oct 4, 2026
…ad sheet (#597)

* feat(downloads): show monitored series and simplify the series Download sheet

- A Monitored list in Downloads shows each monitored series, its rule, and
  what downloads next, using the airing calendar for upcoming episodes.
- The series page's Download action opens one sheet: One Time (this episode,
  a season, or all episodes) or Monitor (All Episodes, Future Episodes, or
  Last Season), with delete-after-watching and a storage limit.
- A banner on a monitored series' page says what downloads next.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): keep monitor choices to what the server offers

- A new monitor starts on the first rule the server advertises instead of
  a hidden Future Episodes.
- An existing monitor's tab stays reachable when the server stops offering
  monitoring, so it can still be stopped; saving is disabled there.
- A calendar refresh after a profile switch no longer waits on the old
  profile's load and keeps nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): keep the shown episode version and existing monitor rules

- The Download sheet downloads the episode version the series page shows,
  including an automatic pick, rather than leaving it to the server.
- An existing monitor's rule stays listed when the server stops
  advertising it, and is not resent unless the user changes it.
- Monitored series load their titles and posters four at a time.
- A failed download no longer hides its episode from "next episode".

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): don't call a monitor up to date before its calendar loads

- An idle monitor shows "Monitoring" until the airing calendar has loaded
  for the profile, instead of "Up to date".
- The Download sheet treats an episode whose download request is still in
  flight as on its way, so it isn't offered again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): back off series detail reads that failed

A monitored series whose title and poster read failed isn't read again
until the calendar refresh interval passes, instead of on every view
appearance.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): fence the monitor schedule by scope and load

- A schedule loaded for another server or profile reads as empty and not
  loaded, so a switched profile shows "Monitoring" until its own loads.
- Each calendar load carries a token; only the current one publishes or
  clears the in-flight slot.
- The Monitor tab is hidden for a new monitor when the server advertises no
  rule the sheet offers, such as specific seasons only.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): scope monitored series titles and posters to the profile

Series titles and posters are read through a scope-checked accessor, and a
details load after a profile switch first drops the previous profile's
data instead of storing alongside it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): mention monitoring on the empty Downloads screen

When the server offers monitoring, the empty Downloads screen also says how
to start one, since the Monitored list is reached from Downloads only once
something is downloaded or monitored.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(downloads): choose a quality for season downloads and monitors (#598)

* feat(downloads): choose a quality for season downloads and monitors

- The series Download sheet has a Quality row for one-time downloads and
  monitors. It starts at the quality set in Settings, and an existing
  monitor opens with its own.
- Season and series downloads send the chosen quality, and monitors store
  it, on servers that report bulk_quality and monitor_quality. Older servers
  keep original quality, and the sheet says so.
- A monitor at a lower quality shows it in the Monitored list.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): describe season and monitor quality in Settings

The download quality footer says the setting is the default for every
download and monitor when the server takes a quality for seasons, and keeps
"original quality" for seasons only on servers that don't.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): drop quality choices the server stops offering

A one-time or new-monitor quality the server no longer offers falls back to
the Settings default when the presets change, so the menu never shows a
quality the request wouldn't use. Only an existing monitor's stored quality
stays listed when it isn't offered.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): mention monitors in the quality note only when they take one

On a server that takes a quality for seasons but not for monitors, the
Settings note says monitored series download in original quality.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(downloads): show titles and progress for downloads the server is preparing (#599)

* feat(downloads): show titles and progress for downloads the server is preparing

- Season, series, and monitor downloads arrive without a title or artwork,
  and their manifest was read only once the file was ready. The app now
  reads each untitled download's manifest right away for its title,
  episode number, and series poster.
- A preparing row shows the server's queue position or encode progress and
  time left, on servers that report preparation_progress.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): retry display reads after connection failures

Only a refusal of a download (a 4xx other than a timeout or rate limit)
stops its manifest being read again this session. A connection failure,
timeout, or busy server ends the pass, and the next pass retries.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): run another display pass for records added during one

Pages of a season registered while a display pass runs now get their own
pass once it finishes, instead of waiting for an unrelated trigger.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): skip an unusable manifest instead of ending the display pass

A manifest the app can't use is now a lasting failure for that download,
like a refusal, so later downloads still get their titles and artwork.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): don't record a display failure from an outdated scope

A manifest read that fails after the server or profile changed no longer
adds its download to the new scope's skip list.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): read display manifests four at a time and retry after outages

- Untitled downloads' manifests are read four at a time instead of one by
  one.
- A pass that a connection failure, timeout, or busy server ends schedules
  another, waiting 15 seconds and doubling up to five minutes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* feat(downloads): show when a download's preparation is paused

A preparing download whose server job an administrator paused reads
"Preparation paused on the server" (Silo-Server/silo-server#1925).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): drop a display retry when the scope changes

A pending display-fill retry is cancelled when the server or profile
changes, and a retry only runs in the scope that scheduled it, so the
previous scope's backoff can't hold back the new scope's retries.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): keep long quality values on one line in the Download sheet

The Quality and Storage limit menus shared the row width with their
label, so a preset like "1 Mbps · up to 480p" wrapped out of the row.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): keep the monitor banner and display-fill retries reachable

Show the series banner for an existing monitor even when the server no
longer offers monitoring, as the Monitored list does, so it can still be
stopped from the series page.

A display-fill retry that woke after its scope was gone returned without
clearing itself, so if that scope came back the finished task blocked
every later retry. It now clears itself before checking the scope.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

* fix(downloads): cancel the display-fill retry on deactivation

Deactivation already cancels the poll and scope-load tasks; the retry
now goes with them instead of waking later to find its scope gone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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