fn spawn_download_worker(
app: AppHandle,
download_id: i64,
item_id: String,
stream_url: String,
target_path: PathBuf,
active_downloads: Arc<Mutex<HashSet<i64>>>,
)Expand description
Spawn the background worker for one download. On completion or failure it unregisters the slot, emits the terminal event, and pumps the queue so the next pending download starts automatically.