Skip to content

feat(tables): optional release-year column on song tables (#698) - #733

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:feat/song-release-year
Oct 10, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
kapok-4o:feat/song-release-year

Conversation

@kapok-4o

@kapok-4o kapok-4o commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #719 for #698: an optional Year column on the song tables.

  • New year column id for songs (playlists, Liked Songs, search results), album_tracks and recently_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 } under tables: to see it. The cell is empty when the date is unknown, including Spotify's 0000.
  • TrackInfo::release_date: Option<String>: a new field with #[serde(default)], so plugin data and last_session.yml written before it still load (a test checks this). Lua plugins see it as track.release_date. gui/src/bindings/TrackInfo.ts is regenerated, and the GUI test fixtures that build a TrackInfo set release_date: null.
  • Where the date comes from:
    • Spotify: the track's album (FullTrack, SimplifiedTrack). An album's own tracklist omits the album, so From<&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.
    • Subsonic: the song's year.
    • Local files: lofty's date/year tag, year only.
    • Qobuz, YouTube, Internet Radio and Apple Music: none. The Qobuz API types in this repo don't carry an album date, and the other three have no release date.
  • album_tracks gets the column too, so the three song tables keep the one shared id list in valid_column_ids. On an album page every row shows the same year, but the column only appears for people who add it.
  • The release_year helper from feat(albums): show the release year on the artist page and sort saved albums by it (#698) #719 moves from tui/ui/artist.rs to tui/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: docs/configuration.md (tables section), docs/scripting.md (the track field), the comment in examples/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 for default, slim (telemetry,tui), headless (telemetry), headless-streaming (telemetry,streaming), telemetry,tui,local-files,subsonic,internet-radio,youtube,qobuz,mcp-server,ai-dj, and gui (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 regenerated TrackInfo.ts. With the default thread count, infra::network::requests::tests::a_stalled_response_gives_up_at_the_deadline_as_a_transient_error failed its < 3s assertion every time on this loaded machine (load average 10–15). It passes when run alone (0.35s), and unmodified upstream/main fails it the same way on this machine (1604 passed, 1 failed). So it was already failing before this change.
  • New tests: 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:

  • The gui/ npm checks (npm ci, lint, format, typecheck, test, build). The 12 TS fixtures were edited by hand to add release_date: null.
  • The Linux all-sources leg, which needs PipeWire.
  • The macos CI job's exact feature set.
  • No test for the librespot and local-file paths: they would need a librespot Track or a tagged audio file. Both compile in the default and gui legs and the all-sources-style leg above.
  • Not tried in a live terminal against a real Spotify account.

Additional notes

  • spotatui.playback().track.release_date is always nil: the now-playing snapshot has no date (the same as image_url there). The scripting docs say so.
  • Possible follow-ups, not done here: a Release Date sort for playlist tracks (the playlist sort still ignores SortField::ReleaseDate), and a date for Qobuz tracks (its album JSON would need a date field added to types::Album).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added an optional Year column to song, album track, and recently played tables. It is hidden by default and shows the album’s release year when available.
    • Release years are available for Spotify and Subsonic tracks, and local files with date tags. Other sources and tracks without a known date show a blank cell.
    • Track release dates are now available to Lua plugins; unavailable dates are reported as empty.

…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]>
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c39a530d-5ab3-4f7c-9a21-88a326ee4bd7

📥 Commits

Reviewing files that changed from the base of the PR and between 6125d62 and ad5a381.


📒 Files selected for processing (56)
  • CHANGELOG.md
  • docs/configuration.md
  • docs/scripting.md
  • examples/config.example.yml
  • gui/e2e/fixtures.ts
  • gui/src/bindings/TrackInfo.ts
  • gui/src/commandModel.test.ts
  • gui/src/discover.test.tsx
  • gui/src/discoverModel.test.ts
  • gui/src/drawer.test.tsx
  • gui/src/library.test.tsx
  • gui/src/libraryModel.test.ts
  • gui/src/queueModel.test.ts
  • gui/src/room.test.tsx
  • gui/src/roomModel.test.ts
  • gui/src/search.test.tsx
  • gui/src/sessionModel.test.ts
  • src/core/action/tests.rs
  • src/core/app/test_support.rs
  • src/core/persisted_playback.rs
  • src/core/plugin_api.rs
  • src/core/sort.rs
  • src/core/test_helpers.rs
  • src/core/user_config.rs
  • src/gui/protocol.rs
  • src/infra/apple_music/mod.rs
  • src/infra/dj/resolve.rs
  • src/infra/local/mod.rs
  • src/infra/network/dj.rs
  • src/infra/network/library.rs
  • src/infra/network/mapping.rs
  • src/infra/network/metadata.rs
  • src/infra/qobuz/mod.rs
  • src/infra/queue/dispatch.rs
  • src/infra/queue/mod.rs
  • src/infra/radio/dispatch.rs
  • src/infra/radio/mod.rs
  • src/infra/scripting/tests.rs
  • src/infra/subsonic/mod.rs
  • src/infra/youtube/dispatch.rs
  • src/infra/youtube/mod.rs
  • src/infra/youtube/playlists.rs
  • src/tui/handlers/album_list.rs
  • src/tui/handlers/album_tracks.rs
  • src/tui/handlers/artist.rs
  • src/tui/handlers/discover.rs
  • src/tui/handlers/mod.rs
  • src/tui/handlers/playlist.rs
  • src/tui/handlers/queue_menu.rs
  • src/tui/handlers/recently_played.rs
  • src/tui/handlers/search_results.rs
  • src/tui/ui/artist.rs
  • src/tui/ui/columns.rs
  • src/tui/ui/search.rs
  • src/tui/ui/tables.rs
  • src/tui/ui/util.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.



📝 Walkthrough

Walkthrough

Track data now includes an optional release date. Songs, album tracks, and recently played tables support an opt-in Year column that displays the date’s year when it is valid. Source mappings, table configuration, tests, and documentation cover the field and column.

Changes

Track release date

Layer / File(s) Summary
Add and propagate track release dates
src/core/plugin_api.rs, gui/src/bindings/TrackInfo.ts, src/infra/..., src/core/..., src/gui/..., gui/src/*test*, src/tui/handlers/*, docs/scripting.md
TrackInfo and the GUI binding include an optional release_date. Local tags, Spotify album data, and Subsonic song years populate it. Album mappings fill missing dates from the parent album. Other listed sources initialize it as absent. Fixtures and scripting documentation include the field.

Year column

Layer / File(s) Summary
Configure and render the Year column
src/core/user_config.rs, src/tui/ui/columns.rs, src/tui/ui/tables.rs, src/tui/ui/util.rs, src/tui/ui/artist.rs
The songs, album_tracks, and recently_played tables accept an opt-in year column with a fixed width of four. The table displays a valid four-digit year or an empty cell. Tests cover the column settings and date formats.
Document the date field and table option
CHANGELOG.md, docs/configuration.md, examples/config.example.yml
The configuration references list year as an optional column and describe which sources provide dates.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant LocalTags
  participant SpotifyMapping
  participant SubsonicSource
  participant TrackInfo
  participant TableConfig
  participant TrackTable
  LocalTags->>TrackInfo: Set release_date from tag year
  SpotifyMapping->>TrackInfo: Set release_date from album year
  SubsonicSource->>TrackInfo: Set release_date from song year
  TableConfig->>TrackTable: Enable the optional year column
  TrackInfo->>TrackTable: Provide release_date
  TrackTable->>TrackTable: Render year or an empty cell
Loading

Merge Risk: ⚪ Minimal · up to ad5a3

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 | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the accepted conventional-commit prefix feat(tables):, remains concise, and accurately describes the optional release-year column added to song tables.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

✨ Simplify code
  • Create a new PR

  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 23 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tui/ui/columns.rs 75.7% 8 Missing ⚠️
src/infra/local/mod.rs 33.3% 6 Missing ⚠️
src/infra/network/metadata.rs 0.0% 6 Missing ⚠️
src/infra/network/library.rs 0.0% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit c250ac6 into LargeModGames:main Oct 10, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants