fix: playlist cover art, compilation tag, and year

- ripPlaylist/ripTrackCollection: pre-fetch playlist artwork once, embed in all tracks
- ripTrack: skip per-track album cover when playlist embed is provided
- buildTagMetadata: set COMPILATION=1 and year from playlist publish_date
- beatport: normalize playlistMetadata to include date fields for year extraction
- qobuz: normalize playlist image_rectangle to standard image map
This commit is contained in:
2026-08-05 23:16:37 +02:00
parent eb7854bac3
commit 8590a5b6b6
4 changed files with 85 additions and 17 deletions
+18
View File
@@ -613,11 +613,13 @@ func (c *Client) getPlaylist(ctx context.Context, playlistID string) (map[string
total, _ := intValue(resp["tracks_count"])
if total <= pageLimit {
normalizePlaylistImage(resp)
return resp, nil
}
tracksObj, ok := mapValue(resp["tracks"])
if !ok {
normalizePlaylistImage(resp)
return resp, nil
}
items, ok := tracksObj["items"].([]any)
@@ -653,9 +655,25 @@ func (c *Client) getPlaylist(ctx context.Context, playlistID string) (map[string
tracksObj["items"] = items
resp["tracks"] = tracksObj
normalizePlaylistImage(resp)
return resp, nil
}
func normalizePlaylistImage(resp map[string]any) {
if resp["image"] != nil {
return
}
rect, ok := resp["image_rectangle"].([]any)
if !ok || len(rect) == 0 {
return
}
url, ok := rect[0].(string)
if !ok || url == "" {
return
}
resp["image"] = map[string]any{"original": url, "large": url}
}
func (c *Client) getLabel(ctx context.Context, labelID string) (map[string]any, error) {
pageLimit := 500
params := url.Values{}