mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-13 08:12:44 +10:00
refactor: Created file settings.rs
Add constant values here to have a central management point for any relevant constants Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@ -2,6 +2,7 @@ use crate::auth::generate_authorization_header;
|
||||
use crate::db::DatabaseImpls;
|
||||
use crate::downloads::manifest::{DropDownloadContext, DropManifest};
|
||||
use crate::remote::RemoteAccessError;
|
||||
use crate::settings::DOWNLOAD_MAX_THREADS;
|
||||
use crate::DB;
|
||||
use log::info;
|
||||
use rayon::ThreadPoolBuilder;
|
||||
@ -24,7 +25,6 @@ pub struct GameDownloadAgent {
|
||||
pub control_flag: Arc<RwLock<DownloadThreadControlFlag>>,
|
||||
pub target_download_dir: usize,
|
||||
contexts: Mutex<Vec<DropDownloadContext>>,
|
||||
// pub progress: ProgressChecker<DropDownloadContext>,
|
||||
pub manifest: Mutex<Option<DropManifest>>,
|
||||
pub progress: ProgressObject,
|
||||
}
|
||||
@ -53,8 +53,6 @@ impl Display for GameDownloadError {
|
||||
}
|
||||
}
|
||||
|
||||
pub const DOWNLOAD_MAX_THREADS: usize = 4;
|
||||
|
||||
pub struct ProgressObject {
|
||||
pub max: u64,
|
||||
pub current: Arc<AtomicU64>,
|
||||
|
||||
@ -4,6 +4,7 @@ mod downloads;
|
||||
mod library;
|
||||
mod p2p;
|
||||
mod remote;
|
||||
mod settings;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
@ -26,8 +27,6 @@ use std::{
|
||||
};
|
||||
use tauri_plugin_deep_link::DeepLinkExt;
|
||||
|
||||
pub const GAME_PAUSE_CHECK_INTERVAL: Duration = Duration::from_secs(1);
|
||||
|
||||
#[derive(Clone, Copy, Serialize)]
|
||||
pub enum AppStatus {
|
||||
NotConfigured,
|
||||
|
||||
1
src-tauri/src/settings.rs
Normal file
1
src-tauri/src/settings.rs
Normal file
@ -0,0 +1 @@
|
||||
pub const DOWNLOAD_MAX_THREADS: usize = 4;
|
||||
Reference in New Issue
Block a user