feat: add Qobuz playlist caching with versioning and infinite scroll UI
- Add qobuz_debug to .gitignore - Bump PMOMusic version to 0.3.26 - Add .cargo/ copy in Dockerfile for registry config - Implement infinite scroll in ServerDrawer.vue with IntersectionObserver and sentinel element - Add source/source_version fields to playlists for cache invalidation - Update pmocache and pmoplaylist DB schemas with versioning (SCHEMA_VERSION) - Add Qobuz API metadata fetching and pagination for playlist tracks - Implement album/playlist cache invalidation based on released_at/updated_at timestamps - Refactor adapt_playlist_items_to_qobuz → adapt_items_to_qobuz with cleaner logic - Add debug mode to save Qobuz API responses when QOBUZ_DEBUG_DIR is set
This commit is contained in:
@@ -404,7 +404,20 @@ impl<C: CacheConfig + 'static> Cache<C> {
|
||||
) -> Result<Self> {
|
||||
let directory = PathBuf::from(dir);
|
||||
std::fs::create_dir_all(&directory)?;
|
||||
let db = DB::init(&directory.join("cache.db"))?;
|
||||
let (db, was_reset) = DB::init(&directory.join("cache.db"))?;
|
||||
|
||||
// Si le schéma a changé, effacer tous les fichiers du cache (cohérence DB/fichiers)
|
||||
if was_reset {
|
||||
tracing::warn!("Cache schema changed, clearing all cache files in {:?}", directory);
|
||||
if let Ok(entries) = std::fs::read_dir(&directory) {
|
||||
for entry in entries.flatten() {
|
||||
let path = entry.path();
|
||||
if path.is_file() && path.file_name().map_or(false, |n| n != "cache.db") {
|
||||
std::fs::remove_file(&path).ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Créer un channel pour les events (capacité de 100 events en buffer)
|
||||
let (served_tx, _) = broadcast::channel(100);
|
||||
|
||||
Reference in New Issue
Block a user