Skip to content

Allow queues and bulk downloading of shows and seasons - #454

Open
Joshmul1 wants to merge 2 commits into
Fredolx:mainfrom
Joshmul1:allow-queues-and-bulk-downloading
Open

Joshmul1 wants to merge 2 commits into
Fredolx:mainfrom
Joshmul1:allow-queues-and-bulk-downloading

Conversation

@Joshmul1

Copy link
Copy Markdown

No description provided.

Joshmul1 and others added 2 commits September 11, 2026 16:56
Starting a second download used to kill the first. The eviction happens in
handle_max_streams: play_stop is a per-source map of cancellation tokens
shared by mpv playback and downloads, and with max_streams defaulting to 1
a new download would shift_remove_index(0) and cancel the running one.

DownloadService now queues instead. download() pushes onto a queue and
returns a promise that settles when the download actually finishes, fails
or is cancelled, so existing callers need no changes, and the backend is
only invoked once the channel's source has no download in flight. Queueing
is per source_id to match how play_stop and max_streams are keyed, so
separate sources still run in parallel without exceeding the limit.

Also:
- abortDownload drops a queued download from the queue rather than calling
  abort_download, which had no token to cancel and would have failed
- cleanup and advancing the queue now happen only in run(), removing the
  double complete.next(true) and double unlisten on cancel
- addDownload returns the existing entry for a duplicate id instead of
  overwriting it and leaking the first unlisten
- the download manager shows queued entries as "Queued" with a striped bar

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Sep 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Joshmul1

Copy link
Copy Markdown
Author

Closes #307

@Joshmul1 Joshmul1 changed the title Allow queues and bulk downloading Allow queues and bulk downloading of shows and seasons Sep 11, 2026
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.

2 participants