refactor: Reorganise file structure

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-05-28 11:19:48 +10:00
parent db1e033ecf
commit 17b3bb0732
41 changed files with 175 additions and 151 deletions
+4 -6
View File
@@ -6,14 +6,12 @@ use std::{
use serde_json::Value;
use crate::{
database::{db::borrow_db_mut_checked},
download_manager::internal_error::InternalError,
};
use crate::{database::db::borrow_db_mut_checked, error::download_manager_error::DownloadManagerError};
use super::{
db::{borrow_db_checked, save_db, DATA_ROOT_DIR},
debug::SystemData, models::data::Settings,
debug::SystemData,
models::data::Settings,
};
// Will, in future, return disk/remaining size
@@ -33,7 +31,7 @@ pub fn delete_download_dir(index: usize) {
}
#[tauri::command]
pub fn add_download_dir(new_dir: PathBuf) -> Result<(), InternalError<()>> {
pub fn add_download_dir(new_dir: PathBuf) -> Result<(), DownloadManagerError<()>> {
// Check the new directory is all good
let new_dir_path = Path::new(&new_dir);
if new_dir_path.exists() {
+3 -7
View File
@@ -1,8 +1,6 @@
use std::{
collections::HashMap,
fs::{self, create_dir_all},
hash::Hash,
path::{Path, PathBuf},
path::PathBuf,
sync::{LazyLock, Mutex, RwLockReadGuard, RwLockWriteGuard},
};
@@ -10,14 +8,12 @@ use chrono::Utc;
use directories::BaseDirs;
use log::{debug, error, info};
use rustbreak::{DeSerError, DeSerializer, PathDatabase, RustbreakError};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_with::serde_as;
use tauri::AppHandle;
use serde::{de::DeserializeOwned, Serialize};
use url::Url;
use crate::DB;
use super::models::data::{Database, GameVersion};
use super::models::data::Database;
pub static DATA_ROOT_DIR: LazyLock<Mutex<PathBuf>> =
LazyLock::new(|| Mutex::new(BaseDirs::new().unwrap().data_dir().join("drop")));
+1 -1
View File
@@ -1,4 +1,4 @@
pub mod commands;
pub mod db;
pub mod debug;
pub mod models;
pub mod models;
+1 -1
View File
@@ -162,7 +162,7 @@ pub mod data {
}
pub mod v2 {
use std::{collections::HashMap, io::ErrorKind, path::PathBuf, process::Command};
use std::{collections::HashMap, path::PathBuf, process::Command};
use crate::process::process_manager::UMU_LAUNCHER_EXECUTABLE;