fix potention spec panic

This commit is contained in:
sentriz
2019-12-05 22:43:35 +00:00
parent b7d764a048
commit f5460da273
2 changed files with 6 additions and 2 deletions

View File

@@ -34,7 +34,6 @@ func NewTCAlbumByFolder(f *model.Album) *TrackChild {
func NewTCTrackByFolder(t *model.Track, parent *model.Album) *TrackChild {
trCh := &TrackChild{
ID: t.ID,
Album: t.Album.RightPath,
ContentType: t.MIME(),
Suffix: t.Ext(),
Size: t.Size,
@@ -57,6 +56,9 @@ func NewTCTrackByFolder(t *model.Track, parent *model.Album) *TrackChild {
if parent.Cover != "" {
trCh.CoverID = parent.ID
}
if t.Album != nil {
trCh.Album = t.Album.RightPath
}
return trCh
}

View File

@@ -41,7 +41,6 @@ func NewTrackByTags(t *model.Track, album *model.Album) *TrackChild {
),
Album: album.TagTitle,
AlbumID: album.ID,
ArtistID: album.TagArtist.ID,
Duration: t.Length,
Bitrate: t.Bitrate,
Type: "music",
@@ -49,6 +48,9 @@ func NewTrackByTags(t *model.Track, album *model.Album) *TrackChild {
if album.Cover != "" {
ret.CoverID = album.ID
}
if album.TagArtist != nil {
ret.ArtistID = album.TagArtist.ID
}
return ret
}