New album_grouping module exports the SQL CASE-WHEN expression for the metadata group key shared by both new queries. The expression has three priorities: (1) usable album tag => album|artist key, (2) fallback to existing folder-based album_group_key, (3) orphan bucket '__unknown_album__'. get_albums_metadata_grouped runs the grouped query and returns LocalAlbum rows with directory_path empty and source_folders populated with the comma-separated list of contributing folders. Pinned 'Unknown Album' to the bottom via ORDER BY. get_album_tracks_metadata fetches all tracks belonging to a metadata group, ordered by disc/track number. Adds idx_local_tracks_album_lookup index on (album, album_artist, artist) to keep the GROUP BY index-backed at 16k+ track libraries. LocalAlbum gains an optional source_folders field (None for folder- grouped rows; Some(comma-separated) for metadata-grouped rows). The existing folder-grouped query continues to populate it as None so no downstream consumer breaks. Hidden filter (album_settings.hidden) does not apply to metadata- grouped rows in this iteration; revisiting requires extending album_settings to support metadata keys. cc
40 lines
745 B
TOML
40 lines
745 B
TOML
[package]
|
|
name = "qbz-library"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Local music library management for QBZ - scanning, indexing, metadata extraction"
|
|
authors = ["blitzkriegfc"]
|
|
|
|
[dependencies]
|
|
# Logging
|
|
log = "0.4"
|
|
|
|
# Serialization
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
|
|
# Error handling
|
|
thiserror = "2"
|
|
|
|
# Database
|
|
rusqlite = { version = "0.31", features = ["bundled"] }
|
|
|
|
# Filesystem
|
|
walkdir = "2"
|
|
dirs = "6"
|
|
|
|
# Audio metadata
|
|
lofty = "0.23"
|
|
|
|
# Image processing (thumbnails)
|
|
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "webp"] }
|
|
|
|
# File system utilities
|
|
glob = "0.3"
|
|
|
|
# UUID generation
|
|
uuid = { version = "1", features = ["v4"] }
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|