feat(slint): local album homologation, Recently Played fixes, local artist nav
Album view (local/Plex): - Rebuild LocalAlbumView as a near copy of the Qobuz AlbumPageView (whole-page scroll, 224px cover, action row, toolbar with quality badge + track search, column header, source-aware rows) minus the label/awards sidebar and Qobuz context menus. Add a per-album client-side track search. Recently Played (Home) — D: - Carry the track source (qobuz|plex|local) through the recently-played store so the cards resolve source-aware artwork (PlexThumb / local file), the album-card play routes to local/Plex playback instead of the empty Qobuz path, and the card click opens the right album view. - Fix a regression from the Plex version split: local_queue_track now derives the content-hash plex_album_key for album_id (navigation) while album_group_key keeps the per-edition split key, so "go to album" and recent Plex albums open correctly. Local artist navigation — B: - Implement open_artist (was a TODO): latch the requested artist and select it once the Artists tab loads. The shared open-artist is now source-aware (numeric id -> Qobuz artist; name -> LocalLibrary Artists tab). Wire the LocalAlbum header artist link and the now-playing "Go to artist" for Plex/local. Folder delete -> Recently Played cascade: - Removing a Local Library folder now also prunes its albums/tracks from the recently-played store (album_keys_in_folder + recently::prune_albums). Covers — C: - Robust on-disk folder cover lookup (cover/folder/front/art/<album>.jpg, any image as a last resort), shared by the Folders subcards and now-playing/album rows. cc
This commit is contained in:
12 files changed
+645
-162
No files matched your search
@@ -1215,6 +1215,29 @@ impl LibraryDatabase {
|
||||
Ok(count)
|
||||
}
|
||||
|
||||
/// Distinct `album_group_key`s of the indexed tracks under `folder` — the
|
||||
/// same keys used as the playback/Recently-Played album id. Call BEFORE
|
||||
/// deleting the folder so the frontend can prune those albums from the
|
||||
/// recently-played store.
|
||||
pub fn album_keys_in_folder(&self, folder: &str) -> Result<Vec<String>, LibraryError> {
|
||||
let pattern = format!("{}/%", folder.trim_end_matches('/'));
|
||||
let mut stmt = self
|
||||
.conn
|
||||
.prepare(
|
||||
"SELECT DISTINCT album_group_key FROM local_tracks
|
||||
WHERE file_path LIKE ? AND album_group_key IS NOT NULL AND album_group_key != ''",
|
||||
)
|
||||
.map_err(|e| LibraryError::Database(e.to_string()))?;
|
||||
let rows = stmt
|
||||
.query_map(params![pattern], |row| row.get::<_, String>(0))
|
||||
.map_err(|e| LibraryError::Database(e.to_string()))?;
|
||||
let mut keys = Vec::new();
|
||||
for k in rows {
|
||||
keys.push(k.map_err(|e| LibraryError::Database(e.to_string()))?);
|
||||
}
|
||||
Ok(keys)
|
||||
}
|
||||
|
||||
/// Remove a folder and its indexed tracks (separator-safe cascade). Mirrors
|
||||
/// the Tauri remove-folder command order: drop the folder row, then the
|
||||
/// tracks under it. Returns the number of tracks removed.
|
||||
|
||||
Reference in new issue
Block a user