mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-14 08:41:21 +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::db::DatabaseImpls;
|
||||||
use crate::downloads::manifest::{DropDownloadContext, DropManifest};
|
use crate::downloads::manifest::{DropDownloadContext, DropManifest};
|
||||||
use crate::remote::RemoteAccessError;
|
use crate::remote::RemoteAccessError;
|
||||||
|
use crate::settings::DOWNLOAD_MAX_THREADS;
|
||||||
use crate::DB;
|
use crate::DB;
|
||||||
use log::info;
|
use log::info;
|
||||||
use rayon::ThreadPoolBuilder;
|
use rayon::ThreadPoolBuilder;
|
||||||
@ -24,7 +25,6 @@ pub struct GameDownloadAgent {
|
|||||||
pub control_flag: Arc<RwLock<DownloadThreadControlFlag>>,
|
pub control_flag: Arc<RwLock<DownloadThreadControlFlag>>,
|
||||||
pub target_download_dir: usize,
|
pub target_download_dir: usize,
|
||||||
contexts: Mutex<Vec<DropDownloadContext>>,
|
contexts: Mutex<Vec<DropDownloadContext>>,
|
||||||
// pub progress: ProgressChecker<DropDownloadContext>,
|
|
||||||
pub manifest: Mutex<Option<DropManifest>>,
|
pub manifest: Mutex<Option<DropManifest>>,
|
||||||
pub progress: ProgressObject,
|
pub progress: ProgressObject,
|
||||||
}
|
}
|
||||||
@ -53,8 +53,6 @@ impl Display for GameDownloadError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const DOWNLOAD_MAX_THREADS: usize = 4;
|
|
||||||
|
|
||||||
pub struct ProgressObject {
|
pub struct ProgressObject {
|
||||||
pub max: u64,
|
pub max: u64,
|
||||||
pub current: Arc<AtomicU64>,
|
pub current: Arc<AtomicU64>,
|
||||||
|
|||||||
@ -4,6 +4,7 @@ mod downloads;
|
|||||||
mod library;
|
mod library;
|
||||||
mod p2p;
|
mod p2p;
|
||||||
mod remote;
|
mod remote;
|
||||||
|
mod settings;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
@ -26,8 +27,6 @@ use std::{
|
|||||||
};
|
};
|
||||||
use tauri_plugin_deep_link::DeepLinkExt;
|
use tauri_plugin_deep_link::DeepLinkExt;
|
||||||
|
|
||||||
pub const GAME_PAUSE_CHECK_INTERVAL: Duration = Duration::from_secs(1);
|
|
||||||
|
|
||||||
#[derive(Clone, Copy, Serialize)]
|
#[derive(Clone, Copy, Serialize)]
|
||||||
pub enum AppStatus {
|
pub enum AppStatus {
|
||||||
NotConfigured,
|
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