refactor: introduce typed resource kind

This commit is contained in:
Mathis Maquenne
2026-08-05 11:33:13 +02:00
parent 3ec258b876
commit 714d567603
11 changed files with 113 additions and 96 deletions
+2 -2
View File
@@ -47,14 +47,14 @@ func (t *Track) GetTitle() string {
return t.Title
}
func (t *Track) GetFileName(resourceType, mediaFormat string) string {
func (t *Track) Filename(kind Kind, mediaFormat string) string {
ext := "mp3"
if mediaFormat == "FLAC" {
ext = "flac"
}
prefix := ""
if resourceType == "album" {
if kind == KindAlbum {
if n, err := strconv.Atoi(t.TrackNumber); err == nil {
prefix = fmt.Sprintf("%02d. ", n)
} else {