fix(smart-playlists): dedupe identical inputs in cover compositor#154
Conversation
Daily Mixes whose top 3 artists share a Deezer picture (or whose fallback album arts all point at the same release) were rendering a 3-strip contact sheet of the same thumbnail. Mirror the hash-level dedup `playlist_cover::top_track_artwork_paths` already applies for user playlists by collapsing duplicate paths in `build_composite_cover` itself, so the layout auto-pick falls through to "1 → fill the canvas" when every input is the same image. Paths here are hash-keyed (`metadata_artwork/<blake3>.jpg` + per-profile `artwork/<hash>.<ext>`), so path equality is content equality. Covers every current and future caller (Daily Mix, user playlist auto-cover, upload re-encode) with one chokepoint.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughCette PR ajoute la déduplication des chemins d'images identiques dans la construction de couvertures composites pour Daily Mix. Les images en doublons pointant vers le même fichier sont désormais filtrées avant mise en page, évitant les compositions répétitives. Un test valide le comportement et la documentation explique la règle appliquée. ChangesDéduplication des couvertures composites
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
Daily Mixes whose top 3 artists share a Deezer picture (or whose fallback album arts all point at the same release) were rendering a 3-strip contact sheet of the same thumbnail (see screenshot in conversation — Daily Mix 2 showing three identical car shots).
Mirrors the hash-level dedup that
playlist_cover::top_track_artwork_pathsalready applies for user playlists, but centralises it insidebuild_composite_coverso every caller (Daily Mix today, future smart families, user-playlist upload re-encode) gets the behaviour for free.When all 3 inputs collapse to one unique path, the layout auto-pick falls through to "1 → fill the canvas" and the cover renders as a single full-bleed tile — matches Spotify on mono-artist playlists.
Test plan
cargo test --manifest-path src-tauri/Cargo.toml --lib smart_playlists::cover→ 8/8 passedcomposite_collapses_identical_inputs_to_single_tile: composites[p, p, p]and[p], asserts identical output hash.Summary by CodeRabbit
Notes de version