mirror of
https://git.sr.ht/~phw/scotty
synced 2025-05-02 22:57:04 +02:00
Reduced redundancy in model conversions and consistent naming
This commit is contained in:
parent
e29d8e2a63
commit
cac88f316b
10 changed files with 107 additions and 107 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue