Skip to content

Commit

Permalink
feat(subsonic): prefer tagged musicbrainz ID over lastfm in getAlbumInfo
Browse files Browse the repository at this point in the history
closes #444
  • Loading branch information
sentriz committed Dec 29, 2023
1 parent b5de0b3 commit 422c684
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/ctrlsubsonic/handlers_by_tags.go
Expand Up @@ -11,6 +11,7 @@ import (
"strings"
"time"

"github.com/google/uuid"
"github.com/jinzhu/gorm"

"go.senan.xyz/gonic/db"
Expand Down Expand Up @@ -413,6 +414,10 @@ func (c *Controller) ServeGetAlbumInfoTwo(r *http.Request) *spec.Response {
sub.AlbumInfo.MusicBrainzID = info.MusicBrainzID
sub.AlbumInfo.LastFMURL = info.LastFMURL

if _, err := uuid.Parse(album.TagBrainzID); err == nil {
sub.AlbumInfo.MusicBrainzID = album.TagBrainzID // prefer db musicbrainz ID over lastfm's
}

return sub
}

Expand Down

0 comments on commit 422c684

Please sign in to comment.