🎨 改进结构

This commit is contained in:
柚子
2025-03-04 16:21:59 +08:00
parent a8fc79feaf
commit 919a62ee60
6 changed files with 15 additions and 13 deletions

View File

@@ -6,9 +6,9 @@ use std::sync::Arc;
use std::net::TcpListener;
use crate::models::download::{DownloadTask, DownloadTaskResponse, InstallStatus, InstallTask, ResponseStatus};
use crate::handlers::server::get_json_server_url;
use crate::utils::{format_icon_url, UA, aria2::Aria2Client};
use crate::utils::{UA, aria2::Aria2Client};
use super::format::{format_size, format_speed};
use super::format::{format_size, format_speed, format_icon_url};
pub struct DownloadManager {
download_queue: Mutex<HashMap<String, DownloadTask>>,
@@ -16,7 +16,7 @@ pub struct DownloadManager {
aria2_started: Arc<AtomicBool>,
aria2_port: Arc<Mutex<u16>>,
aria2_pid: Arc<Mutex<Option<u32>>>,
installing: Arc<AtomicBool>, // 新增:标记是否有正在安装的任务
installing: Arc<AtomicBool>,
}
impl DownloadManager {