HEAVY: finish music service migration, tidy up services, more tests
This commit is contained in:
parent
9e311df462
commit
90a671982c
47 changed files with 2698 additions and 902 deletions
|
|
@ -34,6 +34,8 @@ const (
|
|||
EP ReleaseType = "EP"
|
||||
Compilation ReleaseType = "compilation"
|
||||
Upcoming ReleaseType = "upcoming"
|
||||
|
||||
DEFAULT_RELEASE_ARTWORK_URL = "/img/default-cover-art.png"
|
||||
)
|
||||
|
||||
// GETTERS
|
||||
|
|
@ -52,7 +54,7 @@ func (release Release) PrintReleaseDate() string {
|
|||
|
||||
func (release Release) GetArtwork() string {
|
||||
if release.Artwork == "" {
|
||||
return "/img/default-cover-art.png"
|
||||
return DEFAULT_RELEASE_ARTWORK_URL
|
||||
}
|
||||
return release.Artwork
|
||||
}
|
||||
|
|
@ -93,3 +95,20 @@ func (release Release) PrintArtists(only_primary bool, ampersand bool) string {
|
|||
return strings.Join(names[:], ", ")
|
||||
}
|
||||
}
|
||||
|
||||
func ValidReleaseType(releaseType string) (ReleaseType, bool) {
|
||||
switch releaseType {
|
||||
case "single":
|
||||
return Single, true
|
||||
case "album":
|
||||
return Album, true
|
||||
case "EP":
|
||||
return EP, true
|
||||
case "compilation":
|
||||
return Compilation, true
|
||||
case "upcoming":
|
||||
return Upcoming, true
|
||||
default:
|
||||
return "", false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue