refactor: Reorganise file structure
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
pub mod commands;
|
||||
pub mod db;
|
||||
pub mod debug;
|
||||
pub mod models;
|
||||
pub mod models;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user