refactor(C3): migrate album screen from rspotify types to domain types#321
Merged
Merged
Conversation
Remove rspotify model types from SelectedAlbum and SelectedFullAlbum. Swap in AlbumInfo/Paged<TrackInfo>/TrackInfo from core::plugin_api and core::pagination. The mapping boundary (infra/network/mapping.rs) is the sole conversion site. Changes: - app.rs: SelectedAlbum.album SimplifiedAlbum->AlbumInfo, SelectedAlbum.tracks Page<SimplifiedTrack>->Paged<TrackInfo>, SelectedFullAlbum.album FullAlbum->AlbumInfo - metadata.rs: get_album_tracks maps SimplifiedTrack page via map_page before storing; get_album converts FullAlbum via AlbumInfo::from - tables.rs: draw_album_table reads domain fields (artists.join, duration_ms, id string, join_artist_names for album title line) - album_tracks.rs: all handlers read domain fields; AlbumId/TrackId re-parsed from stored String at dispatch sites (residual ok per plan) - album_list.rs: Enter converts FullAlbum to AlbumInfo via From - mouse.rs: fix tracks.len() for Full context and update test fixture
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.
Summary
SimplifiedAlbum,FullAlbum,Page<SimplifiedTrack>) fromSelectedAlbumandSelectedFullAlbuminsrc/core/app.rsAlbumInfo,Paged<TrackInfo>, andVec<TrackInfo>(embedded inAlbumInfo.tracksfor the Full context)infra/network/mapping.rsboundaryFiles changed
src/core/app.rs: struct field type changes onlysrc/infra/network/metadata.rs:get_album_tracksmaps viamap_page,get_albummaps viaAlbumInfo::fromsrc/tui/ui/tables.rs:draw_album_tablereads domain fields (.artists.join(", "),.duration_ms,.idasOption<String>,join_artist_names)src/tui/handlers/album_tracks.rs: all key handlers updated; rspotifyAlbumId/TrackIdre-parsed from storedStringat dispatch sitessrc/tui/handlers/album_list.rs: Enter convertsFullAlbumtoAlbumInfoviaFromsrc/tui/handlers/mouse.rs: fix.tracks.len()for Full context; update test fixture to domain typesTest plan
cargo fmt --allcleancargo clippy --no-default-features --features telemetry -- -D warningscleancargo test --no-default-features --features telemetrypasses (261/261)cargo build(full) succeedscargo build --no-default-features --features telemetry(slim) succeeds