fix potention spec panic
This commit is contained in:
@@ -34,7 +34,6 @@ func NewTCAlbumByFolder(f *model.Album) *TrackChild {
|
|||||||
func NewTCTrackByFolder(t *model.Track, parent *model.Album) *TrackChild {
|
func NewTCTrackByFolder(t *model.Track, parent *model.Album) *TrackChild {
|
||||||
trCh := &TrackChild{
|
trCh := &TrackChild{
|
||||||
ID: t.ID,
|
ID: t.ID,
|
||||||
Album: t.Album.RightPath,
|
|
||||||
ContentType: t.MIME(),
|
ContentType: t.MIME(),
|
||||||
Suffix: t.Ext(),
|
Suffix: t.Ext(),
|
||||||
Size: t.Size,
|
Size: t.Size,
|
||||||
@@ -57,6 +56,9 @@ func NewTCTrackByFolder(t *model.Track, parent *model.Album) *TrackChild {
|
|||||||
if parent.Cover != "" {
|
if parent.Cover != "" {
|
||||||
trCh.CoverID = parent.ID
|
trCh.CoverID = parent.ID
|
||||||
}
|
}
|
||||||
|
if t.Album != nil {
|
||||||
|
trCh.Album = t.Album.RightPath
|
||||||
|
}
|
||||||
return trCh
|
return trCh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ func NewTrackByTags(t *model.Track, album *model.Album) *TrackChild {
|
|||||||
),
|
),
|
||||||
Album: album.TagTitle,
|
Album: album.TagTitle,
|
||||||
AlbumID: album.ID,
|
AlbumID: album.ID,
|
||||||
ArtistID: album.TagArtist.ID,
|
|
||||||
Duration: t.Length,
|
Duration: t.Length,
|
||||||
Bitrate: t.Bitrate,
|
Bitrate: t.Bitrate,
|
||||||
Type: "music",
|
Type: "music",
|
||||||
@@ -49,6 +48,9 @@ func NewTrackByTags(t *model.Track, album *model.Album) *TrackChild {
|
|||||||
if album.Cover != "" {
|
if album.Cover != "" {
|
||||||
ret.CoverID = album.ID
|
ret.CoverID = album.ID
|
||||||
}
|
}
|
||||||
|
if album.TagArtist != nil {
|
||||||
|
ret.ArtistID = album.TagArtist.ID
|
||||||
|
}
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user