Wire settings: account info, themes, and cache management
- Account section now shows real user name and subscription - Logout button connected to logout handler - Theme switching with persistence (Dark/Light/OLED Black/Warm) - Theme loads on app startup from localStorage - Cache stats display (size, max, track count) - Clear cache functionality with disabled state
This commit is contained in:
1 parent
ef8feebc45
commit
9b8e1352eb
5 files changed
+163
-11
No files matched your search
@@ -0,0 +1,21 @@
|
||||
//! Cache management commands
|
||||
|
||||
use tauri::State;
|
||||
|
||||
use crate::cache::CacheStats;
|
||||
use crate::AppState;
|
||||
|
||||
/// Get cache statistics
|
||||
#[tauri::command]
|
||||
pub fn get_cache_stats(state: State<'_, AppState>) -> CacheStats {
|
||||
log::info!("Command: get_cache_stats");
|
||||
state.audio_cache.stats()
|
||||
}
|
||||
|
||||
/// Clear the audio cache
|
||||
#[tauri::command]
|
||||
pub fn clear_cache(state: State<'_, AppState>) -> Result<(), String> {
|
||||
log::info!("Command: clear_cache");
|
||||
state.audio_cache.clear();
|
||||
Ok(())
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
//! Exposes backend functionality to the frontend via IPC
|
||||
|
||||
pub mod auth;
|
||||
pub mod cache;
|
||||
pub mod favorites;
|
||||
pub mod notification;
|
||||
pub mod playback;
|
||||
@@ -11,6 +12,7 @@ pub mod queue;
|
||||
pub mod search;
|
||||
|
||||
pub use auth::*;
|
||||
pub use cache::*;
|
||||
pub use favorites::*;
|
||||
pub use notification::*;
|
||||
pub use playback::*;
|
||||
|
||||
@@ -127,6 +127,9 @@ pub fn run() {
|
||||
// Notification commands
|
||||
commands::show_track_notification,
|
||||
commands::show_notification,
|
||||
// Cache commands
|
||||
commands::get_cache_stats,
|
||||
commands::clear_cache,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
|
||||
Reference in new issue
Block a user