fix(album): carry the full track row so Properties isn't half empty - #459
Merged
Conversation
Reported in #458: opening a track's Properties from the album page left the Audio and File sections blank, while the same track opened from Tracks / Artist / Genre showed everything. AlbumDetailView has to synthesise a `Track` for the context menu, and `AlbumTrack` never carried those columns — so the mapping filled them with placeholders: `bitrate: null`, `channels: null`, `file_size: 0`, `added_at: 0`, `musical_key: null`, and even `codec: null` despite the row having a codec. The modal then rendered exactly what it was given. Select the columns in `get_album_detail` and map them for real. Also fixes a quieter one found while checking that mapping: `rating` was hard-coded to null, but the context menu's rating submenu is enabled by default on this view — so an already-rated track showed up as unrated, the precise misreport `enableRating: false` exists to prevent elsewhere. The album query now selects the real rating instead. `year` prefers the track's own over the album header's, since a compilation can carry per-track years. Refs #458
|
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 (3)
📝 WalkthroughWalkthroughL’API de détail d’album expose désormais les métadonnées audio et fichier des pistes. Le contrat TypeScript et ChangesMétadonnées des pistes d’album
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 14 UNAVAILABLE: read ECONNRESET Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #458 — @jo-el414 reported that a track's Properties modal shows its Audio and File sections when opened from Tracks / Artist / Genre, but leaves them blank for the same track opened from the album page.
Cause
AlbumDetailViewhas to synthesise a fullTrackfor the context menu (which is what feeds the Properties modal), butAlbumTracknever carried those columns. So the mapping filled them with placeholders:The modal then rendered exactly what it was handed. Nothing was wrong with the modal or the database — the row simply arrived incomplete, and only on this one path.
get_album_detailnow selects those columns and the mapping uses them.A second one, found while verifying
I wrote a comment claiming the rating submenu was disabled on this view, then checked instead of trusting it — it isn't.
enableRatingdefaults totrueandAlbumDetailViewdoesn't override it, so the menu was showing a rating built from a hard-codedrating: null: an already-rated track read as unrated there, which is the exact misreport that option exists to prevent on surfaces genuinely lacking a rating.Rather than hide the submenu, the album query now selects the real rating — consistent with every other view, and rating from the album page keeps working.
Detail
yearprefers the track's own value over the album header's, since a compilation can carry per-track years.Verification
cargo check -p waveflow,bun run typecheck,bun run lint, prettier — all clean (exit codes read directly).Not visually verified: the app can't run outside the Tauri shell here, so this is reasoned from the data path and the reporter's screenshots. The check is quick though — open Properties on an album track and compare with the same track from the Tracks view.
Summary by CodeRabbit