diff --git a/pages/auth/failed.vue b/pages/auth/failed.vue index db8a6e5..1eca3c0 100644 --- a/pages/auth/failed.vue +++ b/pages/auth/failed.vue @@ -26,7 +26,7 @@ import { XCircleIcon } from "@heroicons/vue/16/solid"; const route = useRoute(); -const message = route.query.error ?? "An unknown error occurred."; +const message = route.query.error ?? "An unknown error occurred"; definePageMeta({ layout: "mini", diff --git a/pages/library/[id]/index.vue b/pages/library/[id]/index.vue index b056713..e34c994 100644 --- a/pages/library/[id]/index.vue +++ b/pages/library/[id]/index.vue @@ -320,7 +320,7 @@ const installDir = ref(0); async function install() { try { if (!versionOptions.value) - throw new Error("Versions have not been loaded."); + throw new Error("Versions have not been loaded"); installLoading.value = true; await invoke("download_game", { gameId: game.value.id, diff --git a/pages/settings/downloads.vue b/pages/settings/downloads.vue index a08810c..df3dabc 100644 --- a/pages/settings/downloads.vue +++ b/pages/settings/downloads.vue @@ -254,7 +254,7 @@ async function submitDirectory() { try { error.value = undefined; if (!currentDirectory.value) - throw new Error("Please select a directory first."); + throw new Error("Please select a directory first"); createDirectoryLoading.value = true; // Add directory diff --git a/src-tauri/src/autostart.rs b/src-tauri/src/autostart.rs index da0c1aa..6a4255c 100644 --- a/src-tauri/src/autostart.rs +++ b/src-tauri/src/autostart.rs @@ -7,10 +7,10 @@ pub fn toggle_autostart_logic(app: AppHandle, enabled: bool) -> Result<(), Strin let manager = app.autolaunch(); if enabled { manager.enable().map_err(|e| e.to_string())?; - debug!("Enabled autostart"); + debug!("enabled autostart"); } else { manager.disable().map_err(|e| e.to_string())?; - debug!("Disabled autostart"); + debug!("eisabled autostart"); } // Store the state in DB @@ -56,10 +56,10 @@ pub fn sync_autostart_on_startup(app: &AppHandle) -> Result<(), String> { if current_state != should_be_enabled { if should_be_enabled { manager.enable().map_err(|e| e.to_string())?; - debug!("Synced autostart: enabled"); + debug!("synced autostart: enabled"); } else { manager.disable().map_err(|e| e.to_string())?; - debug!("Synced autostart: disabled"); + debug!("synced autostart: disabled"); } } diff --git a/src-tauri/src/cleanup.rs b/src-tauri/src/cleanup.rs index b45fb06..b8c3880 100644 --- a/src-tauri/src/cleanup.rs +++ b/src-tauri/src/cleanup.rs @@ -9,13 +9,13 @@ pub fn quit(app: tauri::AppHandle, state: tauri::State<'_, std::sync::Mutex>>) { - debug!("Cleaning up and exiting application"); + debug!("cleaning up and exiting application"); let download_manager = state.lock().unwrap().download_manager.clone(); match download_manager.ensure_terminated() { Ok(res) => { match res { - Ok(_) => debug!("Download manager terminated correctly"), - Err(_) => error!("Download manager failed to terminate correctly"), + Ok(_) => debug!("download manager terminated correctly"), + Err(_) => error!("download manager failed to terminate correctly"), } }, Err(e) => panic!("{:?}", e), diff --git a/src-tauri/src/database/commands.rs b/src-tauri/src/database/commands.rs index a740cf4..00c1c48 100644 --- a/src-tauri/src/database/commands.rs +++ b/src-tauri/src/database/commands.rs @@ -66,7 +66,7 @@ pub fn update_settings(new_settings: Value) { } let new_settings: Settings = serde_json::from_value(current_settings).unwrap(); db_lock.settings = new_settings; - println!("New Settings: {:?}", db_lock.settings); + println!("new Settings: {:?}", db_lock.settings); } #[tauri::command] pub fn fetch_settings() -> Settings { diff --git a/src-tauri/src/database/db.rs b/src-tauri/src/database/db.rs index ec3cdc8..82a2e44 100644 --- a/src-tauri/src/database/db.rs +++ b/src-tauri/src/database/db.rs @@ -130,7 +130,7 @@ impl DatabaseImpls for DatabaseInterface { let games_base_dir = data_root_dir.join("games"); let logs_root_dir = data_root_dir.join("logs"); - debug!("Creating data directory at {:?}", data_root_dir); + debug!("creating data directory at {:?}", data_root_dir); create_dir_all(data_root_dir.clone()).unwrap(); create_dir_all(games_base_dir.clone()).unwrap(); create_dir_all(logs_root_dir.clone()).unwrap(); diff --git a/src-tauri/src/download_manager/download_manager_builder.rs b/src-tauri/src/download_manager/download_manager_builder.rs index b1267ae..ade8482 100644 --- a/src-tauri/src/download_manager/download_manager_builder.rs +++ b/src-tauri/src/download_manager/download_manager_builder.rs @@ -179,13 +179,13 @@ impl DownloadManagerBuilder { } } fn manage_queue_signal(&mut self, download_agent: DownloadAgent) { - debug!("Got signal Queue"); + debug!("got signal Queue"); let meta = download_agent.metadata(); - debug!("Queue metadata: {:?}", meta); + debug!("queue metadata: {:?}", meta); if self.download_queue.exists(meta.clone()) { - warn!("Download with same ID already exists"); + warn!("download with same ID already exists"); return; } @@ -199,7 +199,7 @@ impl DownloadManagerBuilder { } fn manage_go_signal(&mut self) { - debug!("Got signal Go"); + debug!("got signal Go"); if self.download_agent_registry.is_empty() { debug!( "Download agent registry: {:?}", @@ -265,7 +265,7 @@ impl DownloadManagerBuilder { active_control_flag.set(DownloadThreadControlFlag::Go); } fn manage_stop_signal(&mut self) { - debug!("Got signal Stop"); + debug!("got signal Stop"); if let Some(active_control_flag) = self.active_control_flag.clone() { self.set_status(DownloadManagerStatus::Paused); @@ -305,7 +305,7 @@ impl DownloadManagerBuilder { self.download_queue.pop_front(); self.cleanup_current_download(); - debug!("Current download queue: {:?}", self.download_queue.read()); + debug!("current download queue: {:?}", self.download_queue.read()); } // TODO: Collapse these two into a single if statement somehow else if let Some(download_agent) = self.download_agent_registry.get(meta) { diff --git a/src-tauri/src/error/application_download_error.rs b/src-tauri/src/error/application_download_error.rs index d469253..d68bd71 100644 --- a/src-tauri/src/error/application_download_error.rs +++ b/src-tauri/src/error/application_download_error.rs @@ -22,11 +22,11 @@ impl Display for ApplicationDownloadError { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { ApplicationDownloadError::Communication(error) => write!(f, "{}", error), - ApplicationDownloadError::Setup(error) => write!(f, "An error occurred while setting up the download: {}", error), - ApplicationDownloadError::Lock => write!(f, "Failed to acquire lock. Something has gone very wrong internally. Please restart the application"), - ApplicationDownloadError::Checksum => write!(f, "Checksum failed to validate for download"), + ApplicationDownloadError::Setup(error) => write!(f, "an error occurred while setting up the download: {}", error), + ApplicationDownloadError::Lock => write!(f, "failed to acquire lock. Something has gone very wrong internally. Please restart the application"), + ApplicationDownloadError::Checksum => write!(f, "checksum failed to validate for download"), ApplicationDownloadError::IoError(error) => write!(f, "{}", error), - ApplicationDownloadError::DownloadError => write!(f, "Download failed. See Download Manager status for specific error"), + ApplicationDownloadError::DownloadError => write!(f, "download failed. See Download Manager status for specific error"), } } } diff --git a/src-tauri/src/error/remote_access_error.rs b/src-tauri/src/error/remote_access_error.rs index cc2fc17..32572b2 100644 --- a/src-tauri/src/error/remote_access_error.rs +++ b/src-tauri/src/error/remote_access_error.rs @@ -40,17 +40,17 @@ impl Display for RemoteAccessError { RemoteAccessError::ParsingError(parse_error) => { write!(f, "{}", parse_error) } - RemoteAccessError::InvalidEndpoint => write!(f, "Invalid drop endpoint"), - RemoteAccessError::HandshakeFailed(message) => write!(f, "Failed to complete handshake: {}", message), - RemoteAccessError::GameNotFound => write!(f, "Could not find game on server"), - RemoteAccessError::InvalidResponse(error) => write!(f, "Server returned an invalid response: {} {}", error.status_code, error.status_message), - RemoteAccessError::InvalidRedirect => write!(f, "Server redirect was invalid"), + RemoteAccessError::InvalidEndpoint => write!(f, "invalid drop endpoint"), + RemoteAccessError::HandshakeFailed(message) => write!(f, "failed to complete handshake: {}", message), + RemoteAccessError::GameNotFound => write!(f, "could not find game on server"), + RemoteAccessError::InvalidResponse(error) => write!(f, "server returned an invalid response: {} {}", error.status_code, error.status_message), + RemoteAccessError::InvalidRedirect => write!(f, "server redirect was invalid"), RemoteAccessError::ManifestDownloadFailed(status, response) => write!( f, - "Failed to download game manifest: {} {}", + "failed to download game manifest: {} {}", status, response ), - RemoteAccessError::OutOfSync => write!(f, "Server's and client's time are out of sync. Please ensure they are within at least 30 seconds of each other."), + RemoteAccessError::OutOfSync => write!(f, "server's and client's time are out of sync. Please ensure they are within at least 30 seconds of each other"), RemoteAccessError::Generic(message) => write!(f, "{}", message), } } diff --git a/src-tauri/src/error/setup_error.rs b/src-tauri/src/error/setup_error.rs index bae7fea..bd76ce5 100644 --- a/src-tauri/src/error/setup_error.rs +++ b/src-tauri/src/error/setup_error.rs @@ -8,7 +8,7 @@ pub enum SetupError { impl Display for SetupError { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { - SetupError::Context => write!(f, "Failed to generate contexts for download"), + SetupError::Context => write!(f, "failed to generate contexts for download"), } } } diff --git a/src-tauri/src/games/downloads/download_agent.rs b/src-tauri/src/games/downloads/download_agent.rs index 8ed6ac4..c22f83a 100644 --- a/src-tauri/src/games/downloads/download_agent.rs +++ b/src-tauri/src/games/downloads/download_agent.rs @@ -178,11 +178,8 @@ impl GameDownloadAgent { let chunk_count = contexts.iter().map(|chunk| chunk.length).sum(); - debug!("Setting ProgressObject max to {}", chunk_count); self.progress.set_max(chunk_count); - debug!("Setting ProgressObject size to {}", length); self.progress.set_size(length); - debug!("Setting ProgressObject time to now"); self.progress.set_time_now(); } diff --git a/src-tauri/src/games/downloads/download_logic.rs b/src-tauri/src/games/downloads/download_logic.rs index 87f057f..fa5372f 100644 --- a/src-tauri/src/games/downloads/download_logic.rs +++ b/src-tauri/src/games/downloads/download_logic.rs @@ -151,7 +151,7 @@ pub fn download_game_chunk( let content_length = response.content_length(); if content_length.is_none() { - warn!("Recieved 0 length content from server"); + warn!("recieved 0 length content from server"); return Err(ApplicationDownloadError::Communication( RemoteAccessError::InvalidResponse(response.json().unwrap()), )); diff --git a/src-tauri/src/games/library.rs b/src-tauri/src/games/library.rs index 894cd05..363b999 100644 --- a/src-tauri/src/games/library.rs +++ b/src-tauri/src/games/library.rs @@ -205,7 +205,7 @@ pub fn fetch_game_verion_options_logic( } pub fn uninstall_game_logic(meta: DownloadableMetadata, app_handle: &AppHandle) { - println!("Triggered uninstall for agent"); + println!("triggered uninstall for agent"); let mut db_handle = DB.borrow_data_mut().unwrap(); db_handle .applications diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 02df0f7..d5c73e9 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -121,7 +121,7 @@ fn setup(handle: AppHandle) -> AppState<'static> { let download_manager = Arc::new(DownloadManagerBuilder::build(handle.clone())); let process_manager = Arc::new(Mutex::new(ProcessManager::new(handle.clone()))); - debug!("Checking if database is set up"); + debug!("checking if database is set up"); let is_set_up = DB.database_is_set_up(); if !is_set_up { return AppState { @@ -133,7 +133,7 @@ fn setup(handle: AppHandle) -> AppState<'static> { }; } - debug!("Database is set up"); + debug!("database is set up"); // TODO: Account for possible failure let (app_status, user) = auth::setup(); @@ -183,7 +183,7 @@ fn setup(handle: AppHandle) -> AppState<'static> { // Sync autostart state if let Err(e) = autostart::sync_autostart_on_startup(&handle) { - warn!("Failed to sync autostart state: {}", e); + warn!("failed to sync autostart state: {}", e); } AppState { @@ -320,7 +320,7 @@ pub fn run() { } _ => { - println!("Menu event not handled: {:?}", event.id); + println!("menu event not handled: {:?}", event.id); } }) .build(app) diff --git a/src-tauri/src/remote/auth.rs b/src-tauri/src/remote/auth.rs index ba2c663..56cb89d 100644 --- a/src-tauri/src/remote/auth.rs +++ b/src-tauri/src/remote/auth.rs @@ -111,7 +111,7 @@ fn recieve_handshake_logic(app: &AppHandle, path: String) -> Result<(), RemoteAc let endpoint = base_url.join("/api/v1/client/auth/handshake")?; let client = reqwest::blocking::Client::new(); let response = client.post(endpoint).json(&body).send()?; - debug!("Handshake responsded with {}", response.status().as_u16()); + debug!("handshake responsded with {}", response.status().as_u16()); let response_struct: HandshakeResponse = response.json()?; { @@ -166,7 +166,7 @@ pub fn auth_initiate_logic() -> Result<(), RemoteAccessError> { if response.status() != 200 { let data: DropServerError = response.json()?; - error!("Could not start handshake: {}", data.status_message); + error!("could not start handshake: {}", data.status_message); return Err(RemoteAccessError::HandshakeFailed(data.status_message)); }