feat(cache): fix lazy PK metadata resolution and playlist track ordering
- In `track_metadata.rs`, implement fallback logic for lazy PKs: first try real_pk, then fallback to lazy_pk for metadata keys seeded before download. - In `db.rs`, add debug logging after migration to track remaining metadata under lazy_pk. - In `source.rs` (Qobuz): - Detect and repair playlists with missing cache entries by forcing refresh when `items.len() < total`. - Preserve original track order after parallel processing by attaching and sorting on original index. - Handle missing performer/cover gracefully with warnings and provider fallback. - In `metadata_cache.rs` (Radio France), simplify logging and improve test coverage for expiration logic. - In `cache.rs`, add debug/warning logs when metadata or cover seeding fails during lazy caching.
This commit is contained in:
@@ -1137,7 +1137,23 @@ impl DB {
|
||||
return Err(Error::QueryReturnedNoRows);
|
||||
}
|
||||
|
||||
tx.commit()
|
||||
tx.commit()?;
|
||||
|
||||
// Compter les métadonnées encore sous l'ancien lazy_pk (après migration de l'asset)
|
||||
let meta_under_lazy: i64 = {
|
||||
let conn = self.lock_conn("update_lazy_to_downloaded_meta_check");
|
||||
conn.query_row(
|
||||
"SELECT COUNT(*) FROM metadata WHERE pk = ?1",
|
||||
[lazy_pk],
|
||||
|r| r.get(0),
|
||||
).unwrap_or(0)
|
||||
};
|
||||
tracing::debug!(
|
||||
"update_lazy_to_downloaded: {} → {} ({} metadata rows still under lazy_pk)",
|
||||
lazy_pk, real_pk, meta_under_lazy
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Recherche une entry par son origin_url
|
||||
|
||||
Reference in New Issue
Block a user