fix(downloads): Fix rearranging download queue throwing error

This commit is contained in:
quexeky
2025-01-25 23:20:31 +11:00
parent 224ff2d015
commit 91e811b32a
3 changed files with 12 additions and 6 deletions
@@ -167,6 +167,10 @@ impl DownloadManager {
self.command_sender
.send(DownloadManagerSignal::UpdateUIQueue)
.unwrap();
self.command_sender
.send(DownloadManagerSignal::Go)
.unwrap();
}
pub fn pause_downloads(&self) {
self.command_sender
@@ -209,11 +209,13 @@ impl DownloadManagerBuilder {
}
if self.current_download_agent.is_some() {
debug!(
"Current download agent: {:?}",
self.current_download_agent.as_ref().unwrap().metadata()
);
return;
if self.download_queue.read().front().unwrap() == &self.current_download_agent.as_ref().unwrap().metadata() {
debug!(
"Current download agent: {:?}",
self.current_download_agent.as_ref().unwrap().metadata()
);
return;
}
}
debug!("current download queue: {:?}", self.download_queue.read());