Repository navigation
feat(tables): optional release-year column on song tables (#698) - #733
Conversation
…mes#698) TrackInfo gains an additive `release_date` (serde default, so older plugin data and last_session.yml still load). Spotify fills it from the track's album (full and simplified tracks, the album tracklists backfilled from the parent album, and the librespot-read Spotify-owned playlists), Subsonic from the song's `year`, and local files from the date/year tag. Qobuz, YouTube, radio and Apple Music leave it None. The song tables (`songs`, `album_tracks`, `recently_played`) accept a new `year` column id rendering the first four digits, empty for an unknown or `0000` date. It is in no default column list, so existing layouts are unchanged. The `release_year` helper moves from tui/ui/artist.rs to tui/ui/util.rs to be shared. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to This adds an optional, off-by-default Year column and a release date field on tracks. No concrete risk to existing behavior was found, so it looks safe to merge. Pre-merge checks |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
Follow-up to #719 for #698: an optional Year column on the song tables.
yearcolumn id forsongs(playlists, Liked Songs, search results),album_tracksandrecently_played. It shows the release year of the track's album and is 4 cells wide. It is in no default column list, so nobody's layout changes; add- { id: year }undertables:to see it. The cell is empty when the date is unknown, including Spotify's0000.TrackInfo::release_date: Option<String>: a new field with#[serde(default)], so plugin data andlast_session.ymlwritten before it still load (a test checks this). Lua plugins see it astrack.release_date.gui/src/bindings/TrackInfo.tsis regenerated, and the GUI test fixtures that build aTrackInfosetrelease_date: null.FullTrack,SimplifiedTrack). An album's own tracklist omits the album, soFrom<&FullAlbum>and the album-tracks fetch fill it from the album that was opened. The Spotify-owned playlists read through librespot get the album's year, or none when librespot reports year 0.year.album_tracksgets the column too, so the three song tables keep the one shared id list invalid_column_ids. On an album page every row shows the same year, but the column only appears for people who add it.release_yearhelper from feat(albums): show the release year on the artist page and sort saved albums by it (#698) #719 moves fromtui/ui/artist.rstotui/ui/util.rs, so the artist page and the tables share it. The artist page works the same as before, and its tests are unchanged.docs/configuration.md(tables section),docs/scripting.md(the track field), the comment inexamples/config.example.yml, and a CHANGELOG "Added" entry.Testing
rustc / clippy 1.99.0, macOS (aarch64):
cargo fmt --all --check: clean.cargo clippy --locked <leg> -- -D warnings: clean fordefault,slim(telemetry,tui),headless(telemetry),headless-streaming(telemetry,streaming),telemetry,tui,local-files,subsonic,internet-radio,youtube,qobuz,mcp-server,ai-dj, andgui(telemetry,gui,streaming,discord-rpc,self-update,scripting,mcp-server,mpris).cargo test --locked:default: 1901 passed.slim: 1494 passed.telemetry,tui,local-files,subsonic,internet-radio,youtube,qobuz,mcp-server,ai-dj: 2028 passed, 22 ignored. The first run had one failure in the timing test noted below. A second run passed.gui: 1608 passed with--test-threads=4. This run regeneratedTrackInfo.ts. With the default thread count,infra::network::requests::tests::a_stalled_response_gives_up_at_the_deadline_as_a_transient_errorfailed its< 3sassertion every time on this loaded machine (load average 10–15). It passes when run alone (0.35s), and unmodifiedupstream/mainfails it the same way on this machine (1604 passed, 1 failed). So it was already failing before this change.the_year_column_renders_the_album_release_year,the_year_column_is_empty_for_an_unknown_release_date,a_configured_year_column_shows_in_the_song_table,the_year_column_is_in_no_default_column_list,song_tables_accept_a_configured_year_column,release_year_reads_the_first_four_digits_of_any_date_precision,release_year_is_none_for_a_missing_short_or_zero_date,full_track_carries_its_album_release_date,full_album_tracks_take_the_album_release_date,track_info_without_a_release_date_key_still_deserializes,subsonic_song_year_fills_the_track_release_date.Not run here:
gui/npm checks (npm ci, lint, format, typecheck, test, build). The 12 TS fixtures were edited by hand to addrelease_date: null.all-sourcesleg, which needs PipeWire.macosCI job's exact feature set.Trackor a tagged audio file. Both compile in the default and gui legs and the all-sources-style leg above.Additional notes
spotatui.playback().track.release_dateis alwaysnil: the now-playing snapshot has no date (the same asimage_urlthere). The scripting docs say so.SortField::ReleaseDate), and a date for Qobuz tracks (its album JSON would need a date field added totypes::Album).🤖 Generated with Claude Code
Summary by CodeRabbit