Compare commits
No commits in common. "9d976b49ab1b562b19f167c95f959882ec8ea31d" and "a46bc063ffcd93d8fb95d706ff4cdadee5b2d571" have entirely different histories.
9d976b49ab
...
a46bc063ff
13
src/main.rs
13
src/main.rs
@ -109,17 +109,13 @@ async fn download_multiple(args: CLIArgs, raw_urls: Vec<String>) -> Result<()> {
|
||||
}
|
||||
|
||||
async fn download_job(urls: SyncQueue, reporter: UnboundedSender<DlReport>, cli_args: CLIArgs) {
|
||||
// The mutex access must be in its own scope to ensure that the lock is dropped
|
||||
while let Some(dlreq) = {
|
||||
let mut urls = urls.lock().await;
|
||||
urls.pop_front().take()
|
||||
} {
|
||||
println!("Downloading {}", dlreq.url);
|
||||
while let Some(dlreq) = urls.lock().await.pop_front() {
|
||||
let reporter = DlReporter::new(dlreq.id as u32, reporter.clone());
|
||||
|
||||
// Resolve the zippy url to the direct download url if necessary
|
||||
let url = match is_integrated_url(&dlreq.url) {
|
||||
Some(service) => match resolve_integrated_url(&dlreq.url, service).await {
|
||||
Some(service) => {
|
||||
match resolve_integrated_url(&dlreq.url, service).await {
|
||||
Ok(url) => url,
|
||||
Err(_e) => {
|
||||
report_msg!(
|
||||
@ -129,7 +125,8 @@ async fn download_job(urls: SyncQueue, reporter: UnboundedSender<DlReport>, cli_
|
||||
);
|
||||
continue;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
None => dlreq.url,
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user