@@ -503,7 +503,7 @@ func WriteRelease(
503503 normtag .Set (t , normtag .CatalogueNum , trimZero (labelInfo .CatalogNumber )... )
504504 normtag .Set (t , normtag .Barcode , trimZero (release .Barcode )... )
505505 normtag .Set (t , normtag .Compilation , trimZero (formatBool (musicbrainz .IsCompilation (release .ReleaseGroup )))... )
506- normtag .Set (t , normtag .ReleaseType , trimZero (strings . ToLower ( string ( release .ReleaseGroup . PrimaryType )) )... )
506+ normtag .Set (t , normtag .ReleaseType , trimZero (releaseTypes ( release .ReleaseGroup ) ... )... )
507507
508508 normtag .Set (t , normtag .MusicBrainzReleaseID , trimZero (release .ID )... )
509509 normtag .Set (t , normtag .MusicBrainzReleaseGroupID , trimZero (release .ReleaseGroup .ID )... )
@@ -1165,6 +1165,17 @@ func trimZero[T comparable](elms ...T) []T {
11651165 return slices .DeleteFunc (elms , func (t T ) bool { return t == zero })
11661166}
11671167
1168+ func releaseTypes (rg musicbrainz.ReleaseGroup ) []string {
1169+ var types []string
1170+ if rg .PrimaryType != "" {
1171+ types = append (types , strings .ToLower (string (rg .PrimaryType )))
1172+ }
1173+ for _ , st := range rg .SecondaryTypes {
1174+ types = append (types , strings .ToLower (string (st )))
1175+ }
1176+ return types
1177+ }
1178+
11681179func parseAnyTime (str string ) time.Time {
11691180 t , _ := dateparse .ParseAny (str )
11701181 return t
0 commit comments