feat(subsonic): emit coverArt id unconditionally (#296)
getCoverArt now falls back to sidecar images next to the first track in an album, so browse responses can advertise a coverArt id whether or not albums.cover_art_path is set. Worst case the client gets a Subsonic 70 when no sidecar exists.
This commit is contained in:
@@ -288,12 +288,11 @@ func songRef(t dbq.Track, albumTitle, artistName string) SongRef {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// coverArtID uses the album ID as the cover-art key since Minstrel's getCoverArt
|
// coverArtID returns the album UUID as the cover-art key. getCoverArt uses
|
||||||
// will resolve from albums.cover_art_path. Returns "" when no cover art exists.
|
// the album row to find art either in cover_art_path (when the scanner sets
|
||||||
|
// it) or via sidecar lookup in the album directory, so emitting the id
|
||||||
|
// unconditionally is safe — worst case getCoverArt returns a Subsonic 70.
|
||||||
func coverArtID(a dbq.Album) string {
|
func coverArtID(a dbq.Album) string {
|
||||||
if a.CoverArtPath == nil || *a.CoverArtPath == "" {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return uuidToID(a.ID)
|
return uuidToID(a.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user