Songs imported from a streaming source arrived in the library without a cover, and untagged downloads such as Bilibili audio arrived as their file name with "Unknown Artist". Stacked on #702, which adds the artwork registry this uses.
Changes
After an import or a confirmed replace, a song takes the title and artist the user picked it by (the file's values stay only when the source gives none), and the source's artwork when the file embeds none. Neither step fails the import.
StreamingSource::artwork returns cover bytes; the plugin source loads them through the same cache and resource-origin checks as listing covers.
set_cover_art is split out of embedded-cover extraction so both paths store covers and derivatives the same way.
Contract note in catalog.md.
Screenshots
Release build with a real Bilibili account, importing one public favorite. Before: the title is the file name and the artist is unknown. After: the video title and its uploader. The cover came from the video in both runs because this file happens to embed one; the unit test covers a file without one.
Before
After
Test plan
cargo test --release --lib -- catalog library: 215 passed, including the new an_untagged_import_takes_the_source_title_artist_and_artwork
cargo clippy --release --lib --tests: clean
Release app: imported a Bilibili favorite; the library row shows the video cover, its title and its uploader
Reviewing files that changed from the base of the PR and between 39502ae3981cf727f47a786147ab9e8acbb9c8e6 and a3e4f179c539726c4cfdb3379b3ba01eb4d0c8ce.
Files selected for processing: 6
docs/references/contracts/catalog.md
src-tauri/src/catalog/import.rs
src-tauri/src/catalog/plugin.rs
src-tauri/src/catalog/streaming.rs
src-tauri/src/library/import/cover.rs
src-tauri/src/library/import/mod.rs
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.