refactor(downloads): Ran cargo clippy & moved DownloadManagerInterface

Created file "download_manager_interface.rs" to contain the DownloadManagerInterface

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-11-13 21:05:25 +11:00
parent a1ada07690
commit 075d6ecf3c
7 changed files with 151 additions and 127 deletions

View File

@ -4,13 +4,11 @@ use crate::downloads::manifest::{DropDownloadContext, DropManifest};
use crate::remote::RemoteAccessError;
use crate::DB;
use log::info;
use rayon::{spawn, ThreadPool, ThreadPoolBuilder};
use rayon::ThreadPoolBuilder;
use std::fmt::{Display, Formatter};
use std::fs::{create_dir_all, File};
use std::path::Path;
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use std::sync::{Arc, Mutex};
use std::thread::Thread;
use std::sync::Mutex;
use urlencoding::encode;
#[cfg(target_os = "linux")]
@ -137,7 +135,7 @@ impl GameDownloadAgent {
.values()
.map(|chunk| chunk.lengths.len())
.sum();
self.progress.set_max(length.try_into().unwrap());
self.progress.set_max(length);
self.progress.set_size(chunk_count);
if let Ok(mut manifest) = self.manifest.lock() {