This commit is contained in:
Drew Weymouth
2023-02-22 19:17:32 -08:00
parent d25baa9869
commit d86f92c524
+2 -1
View File
@@ -191,13 +191,14 @@ func (p *PlaybackManager) GetPlayQueue() []*subsonic.Child {
// Any time the user changes the favorite status of a track elsewhere in the app, // Any time the user changes the favorite status of a track elsewhere in the app,
// this should be called to ensure the in-memory track model is updated. // this should be called to ensure the in-memory track model is updated.
func (p *PlaybackManager) OnTrackFavoriteStatusChanged(id string, fav bool) { func (p *PlaybackManager) OnTrackFavoriteStatusChanged(id string, fav bool) {
tr := sharedutil.FindTrackByID(id, p.playQueue) if tr := sharedutil.FindTrackByID(id, p.playQueue); tr != nil {
if fav { if fav {
tr.Starred = time.Now() tr.Starred = time.Now()
} else { } else {
tr.Starred = time.Time{} tr.Starred = time.Time{}
} }
} }
}
// trackIdxs must be sorted // trackIdxs must be sorted
func (p *PlaybackManager) RemoveTracksFromQueue(trackIdxs []int) { func (p *PlaybackManager) RemoveTracksFromQueue(trackIdxs []int) {