ensure play queue track state is updated on favorite/unfavorite and scrobbles

This commit is contained in:
Drew Weymouth
2023-02-22 18:42:16 -08:00
parent 4cef01f1ca
commit d25baa9869
7 changed files with 65 additions and 16 deletions
+19
View File
@@ -0,0 +1,19 @@
package sharedutil
import "github.com/dweymouth/go-subsonic/subsonic"
func FindTrackByID(id string, tracks []*subsonic.Child) *subsonic.Child {
for _, tr := range tracks {
if id == tr.ID {
return tr
}
}
return nil
}
func TrackIDOrEmptyStr(track *subsonic.Child) string {
if track == nil {
return ""
}
return track.ID
}