Skip to main content

enqueue_download

Function enqueue_download 

Source
pub async fn enqueue_download(
    db: State<'_, DatabaseWrapper>,
    download_manager: State<'_, DownloadManagerWrapper>,
    app: AppHandle,
    download_id: i64,
    stream_url: String,
    target_dir: String,
) -> Result<(), String>
Expand description

Enqueue a download with its resolved stream URL, then let the queue pump start it (or a higher-priority pending item) when a slot is free.

Unlike start_download, this never errors when the concurrency limit is reached: the URL is persisted on the row and the pump will pick it up once a slot frees. This is the path bulk operations (album/series/season) use so every queued item eventually downloads without the frontend re-issuing it.