Skip to content

Commit 3b1a676

Browse files
committed
Fix bug when clustering multiple albums
1 parent bf04324 commit 3b1a676

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Model/Artist.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ module Model.Artist
77
)
88
where
99

10-
import Model.Album qualified as Album
1110
import Data.List.NonEmpty ((<|))
11+
import Data.Text qualified as Text
12+
import Model.Album qualified as Album
1213
import Sound.HTagLib qualified as HTagLib
1314

1415
newtype Artist = Artist (NonEmpty Album.Album)
1516
deriving (Eq, Show)
1617

1718
mkArtist :: NonEmpty Album.Album -> Maybe Artist
1819
mkArtist albums'@(firstAlbum :| otherAlbums)
19-
| (allSameAlbumArtist && (firstAlbumArtist /= "Various Artists"))
20+
| ( allSameAlbumArtist
21+
&& not (Text.null firstAlbumArtist)
22+
&& (firstAlbumArtist /= "Various Artists")
23+
)
2024
|| allSameArtist =
2125
Just $ Artist albums'
2226
| otherwise = Nothing

0 commit comments

Comments
 (0)