diff --git a/Cargo.lock b/Cargo.lock index 208cac68..86e8b4a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "PMOMusic" -version = "0.3.27" +version = "0.3.28" dependencies = [ "axum 0.8.7", "console-subscriber", diff --git a/PMOMusic/Cargo.toml b/PMOMusic/Cargo.toml index a5e304e2..bd17d142 100644 --- a/PMOMusic/Cargo.toml +++ b/PMOMusic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "PMOMusic" -version = "0.3.27" +version = "0.3.28" edition = "2024" [dependencies] diff --git a/pmocache/src/db.rs b/pmocache/src/db.rs index 509000c2..9832f38c 100644 --- a/pmocache/src/db.rs +++ b/pmocache/src/db.rs @@ -18,7 +18,7 @@ use std::sync::{Mutex, MutexGuard}; /// Incrémenter cette constante à chaque modification incompatible du schéma. /// Cela provoquera la suppression de la DB **et de tous les fichiers du cache** /// au prochain démarrage. -pub const SCHEMA_VERSION: u32 = 1; +pub const SCHEMA_VERSION: u32 = 2; use std::time::Instant; #[cfg(feature = "openapi")] diff --git a/pmoqobuz/src/source.rs b/pmoqobuz/src/source.rs index 73a588ac..86fcdfb5 100644 --- a/pmoqobuz/src/source.rs +++ b/pmoqobuz/src/source.rs @@ -767,7 +767,7 @@ impl QobuzSource { &self, qobuz_playlist_id: &str, ) -> Result> { - use tracing::{debug, info}; + use tracing::{debug, info, warn}; let pmo_playlist_id = format!("qobuz-playlist-{}", qobuz_playlist_id); let playlist_manager = pmoplaylist::PlaylistManager(); @@ -845,6 +845,18 @@ impl QobuzSource { } let lazy_pks = self.register_tracks_lazy(&tracks).await; + let all_registered = lazy_pks.len() == tracks.len(); + if !all_registered { + warn!( + "Qobuz playlist {}: only {}/{} tracks registered, will not mark cache as complete", + qobuz_playlist_id, lazy_pks.len(), tracks.len() + ); + // Invalider la source_version pour forcer un refresh au prochain accès + writer + .set_source_version(None) + .await + .map_err(|e| MusicSourceError::PlaylistError(e.to_string()))?; + } writer .push_lazy_batch(lazy_pks) .await diff --git a/version.txt b/version.txt index e01fa856..9578e940 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.3.27 +0.3.28