Reduced redundancy in model conversions and consistent naming

This commit is contained in:
Philipp Wolfer 2023-11-22 17:53:09 +01:00
parent e29d8e2a63
commit cac88f316b
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
10 changed files with 107 additions and 107 deletions

View file

@ -149,11 +149,21 @@ func (t Track) Isrc() string {
}
func (t Track) RecordingMbid() string {
return tryGetValueOrEmpty[string](t.AdditionalInfo, "recording_mbid")
mbid := tryGetValueOrEmpty[string](t.AdditionalInfo, "recording_mbid")
if mbid == "" && t.MbidMapping != nil {
return t.MbidMapping.RecordingMbid
} else {
return mbid
}
}
func (t Track) ReleaseMbid() string {
return tryGetValueOrEmpty[string](t.AdditionalInfo, "release_mbid")
mbid := tryGetValueOrEmpty[string](t.AdditionalInfo, "release_mbid")
if mbid == "" && t.MbidMapping != nil {
return t.MbidMapping.ReleaseMbid
} else {
return mbid
}
}
func (t Track) ReleaseGroupMbid() string {