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
|
package spec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"cmp"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"go.senan.xyz/gonic/db"
|
"go.senan.xyz/gonic/db"
|
||||||
@@ -62,7 +63,7 @@ func NewTCTrackByFolder(t *db.Track, parent *db.Album) *TrackChild {
|
|||||||
Suffix: formatExt(t.Ext()),
|
Suffix: formatExt(t.Ext()),
|
||||||
Size: t.Size,
|
Size: t.Size,
|
||||||
Artist: t.TagTrackArtist,
|
Artist: t.TagTrackArtist,
|
||||||
Title: t.TagTitle,
|
Title: cmp.Or(t.TagTitle, t.Filename),
|
||||||
TrackNumber: t.TagTrackNumber,
|
TrackNumber: t.TagTrackNumber,
|
||||||
DiscNumber: t.TagDiscNumber,
|
DiscNumber: t.TagDiscNumber,
|
||||||
Path: filepath.Join(
|
Path: filepath.Join(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package spec
|
package spec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"cmp"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ func NewTrackByTags(t *db.Track, album *db.Album) *TrackChild {
|
|||||||
Path: filepath.Join(album.LeftPath, album.RightPath, t.Filename),
|
Path: filepath.Join(album.LeftPath, album.RightPath, t.Filename),
|
||||||
Size: t.Size,
|
Size: t.Size,
|
||||||
Suffix: formatExt(t.Ext()),
|
Suffix: formatExt(t.Ext()),
|
||||||
Title: t.TagTitle,
|
Title: cmp.Or(t.TagTitle, t.Filename),
|
||||||
TrackNumber: t.TagTrackNumber,
|
TrackNumber: t.TagTrackNumber,
|
||||||
DiscNumber: t.TagDiscNumber,
|
DiscNumber: t.TagDiscNumber,
|
||||||
Type: "music",
|
Type: "music",
|
||||||
|
|||||||
Reference in New Issue
Block a user