Add Flatpak detection and automatic data migration
Features: - Flatpak runtime detection (/.flatpak-info check) - Automatic migration of user data from old App ID to new ID - Config: ~/.config/com.blitzkriegfc.qbz → ~/.config/qbz - Data: ~/.local/share/com.blitzkriegfc.qbz → ~/.local/share/qbz - Cache: ~/.cache/com.blitzkriegfc.qbz → ~/.cache/qbz - Migration runs on startup before any other initialization - Old directories are preserved (manual cleanup required) - Tauri commands for frontend integration: - is_running_in_flatpak() - get_flatpak_help_text() Migration is non-destructive and idempotent.
This commit is contained in:
1 parent
d2f61974d8
commit
a0467fb10a
2 files changed
+144
No files matched your search
@@ -13,6 +13,7 @@ pub mod config;
|
||||
pub mod credentials;
|
||||
pub mod discogs;
|
||||
pub mod download_cache;
|
||||
pub mod flatpak;
|
||||
pub mod lastfm;
|
||||
pub mod library;
|
||||
pub mod lyrics;
|
||||
@@ -133,6 +134,13 @@ pub fn run() {
|
||||
|
||||
log::info!("QBZ starting...");
|
||||
|
||||
// Migrate data from old App ID if needed
|
||||
match flatpak::migrate_app_id_data() {
|
||||
Ok(true) => log::info!("App ID migration completed successfully"),
|
||||
Ok(false) => log::debug!("No App ID migration needed"),
|
||||
Err(e) => log::error!("App ID migration failed: {}", e),
|
||||
}
|
||||
|
||||
// Initialize library state
|
||||
let library_state = library::init_library_state()
|
||||
.expect("Failed to initialize library database");
|
||||
@@ -605,6 +613,9 @@ pub fn run() {
|
||||
network::commands::get_network_mounts_cmd,
|
||||
network::commands::check_mount_accessible,
|
||||
network::commands::check_network_paths_batch,
|
||||
// Flatpak detection commands
|
||||
flatpak::is_running_in_flatpak,
|
||||
flatpak::get_flatpak_help_text,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
|
||||
Reference in new issue
Block a user