mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 15:25:46 +00:00
fix(ui): split album and track artists (OpenSubsonic) (#696)
* fix(ui): split OpenSubsonic album and track artists in header and player Album detail header uses albumArtists from album or child songs; player bar, mobile player, and mini player use structured track artists with per-id links. Adds deriveAlbumHeaderArtistRefs helper and OpenArtistRefInline. Fixes #552 * docs: changelog and credits for OpenSubsonic artist links (PR #696)
This commit is contained in:
@@ -85,6 +85,14 @@ describe('songToTrack', () => {
|
||||
expect(t.replayGainPeak).toBeUndefined();
|
||||
});
|
||||
|
||||
it('copies OpenSubsonic artists when present', () => {
|
||||
const song = makeSubsonicSong({
|
||||
artists: [{ id: 'a1', name: 'Feat' }, { id: 'a2', name: 'Main' }],
|
||||
});
|
||||
const t = songToTrack(song);
|
||||
expect(t.artists).toEqual(song.artists);
|
||||
});
|
||||
|
||||
it('does not invent fields that the Subsonic song lacks', () => {
|
||||
const song = makeSubsonicSong({});
|
||||
const t = songToTrack(song);
|
||||
@@ -92,5 +100,6 @@ describe('songToTrack', () => {
|
||||
expect(t.autoAdded).toBeUndefined();
|
||||
expect(t.radioAdded).toBeUndefined();
|
||||
expect(t.playNextAdded).toBeUndefined();
|
||||
expect(t.artists).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ export function songToTrack(song: SubsonicSong): Track {
|
||||
album: song.album,
|
||||
albumId: song.albumId,
|
||||
artistId: song.artistId,
|
||||
artists: song.artists && song.artists.length > 0 ? song.artists : undefined,
|
||||
duration: song.duration,
|
||||
coverArt: song.coverArt,
|
||||
track: song.track,
|
||||
|
||||
Reference in New Issue
Block a user