fix(scanner): make sure we have an album artist before populating track

if we return early before i == 0 we mightn't have one

fixes #209
This commit is contained in:
sentriz
2022-04-02 18:01:51 +01:00
parent a8e50c4a01
commit 01747c8940

View File

@@ -219,7 +219,7 @@ func (s *Scanner) populateTrackAndAlbumArtists(tx *db.DB, c *Context, i int, par
} }
// metadata for the album table comes only from the the first track's tags // metadata for the album table comes only from the the first track's tags
if i == 0 { if i == 0 || album.TagArtist == nil {
albumArtist, err := populateAlbumArtist(tx, album, parent, trags.SomeAlbumArtist()) albumArtist, err := populateAlbumArtist(tx, album, parent, trags.SomeAlbumArtist())
if err != nil { if err != nil {
return fmt.Errorf("populate album artist: %w", err) return fmt.Errorf("populate album artist: %w", err)