feat(download ui): debug queue interface

This commit is contained in:
DecDuck
2024-12-09 17:03:48 +11:00
parent d5ac1b0a0e
commit 671d45fbe4
16 changed files with 148 additions and 257 deletions

View File

@ -132,19 +132,23 @@ impl DownloadManager {
let current_index = get_index_from_id(&mut queue, id).unwrap();
let to_move = queue.remove(current_index).unwrap();
queue.insert(new_index, to_move);
self.command_sender.send(DownloadManagerSignal::Update);
}
pub fn rearrange(&self, current_index: usize, new_index: usize) {
let mut queue = self.edit();
let to_move = queue.remove(current_index).unwrap();
queue.insert(new_index, to_move);
self.command_sender.send(DownloadManagerSignal::Update);
}
pub fn remove_from_queue(&self, index: usize) {
self.edit().remove(index);
self.command_sender.send(DownloadManagerSignal::Update);
}
pub fn remove_from_queue_string(&self, id: String) {
let mut queue = self.edit();
let current_index = get_index_from_id(&mut queue, id).unwrap();
queue.remove(current_index);
self.command_sender.send(DownloadManagerSignal::Update);
}
pub fn pause_downloads(&self) {
self.command_sender