feat(subsonic): fallback to filename when title is missing tags
closes #541
This commit is contained in:
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package spec
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"path/filepath"
|
||||
|
||||
"go.senan.xyz/gonic/db"
|
||||
@@ -62,7 +63,7 @@ func NewTCTrackByFolder(t *db.Track, parent *db.Album) *TrackChild {
|
||||
Suffix: formatExt(t.Ext()),
|
||||
Size: t.Size,
|
||||
Artist: t.TagTrackArtist,
|
||||
Title: t.TagTitle,
|
||||
Title: cmp.Or(t.TagTitle, t.Filename),
|
||||
TrackNumber: t.TagTrackNumber,
|
||||
DiscNumber: t.TagDiscNumber,
|
||||
Path: filepath.Join(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package spec
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
|
||||
@@ -78,7 +79,7 @@ func NewTrackByTags(t *db.Track, album *db.Album) *TrackChild {
|
||||
Path: filepath.Join(album.LeftPath, album.RightPath, t.Filename),
|
||||
Size: t.Size,
|
||||
Suffix: formatExt(t.Ext()),
|
||||
Title: t.TagTitle,
|
||||
Title: cmp.Or(t.TagTitle, t.Filename),
|
||||
TrackNumber: t.TagTrackNumber,
|
||||
DiscNumber: t.TagDiscNumber,
|
||||
Type: "music",
|
||||
|
||||
Reference in New Issue
Block a user