fix some interface assertion and nil bugs, and album page not showing now playing

This commit is contained in:
Drew Weymouth
2024-06-01 12:28:48 -07:00
parent bfa3dc9892
commit e180197852
5 changed files with 21 additions and 16 deletions
+2 -2
View File
@@ -78,12 +78,12 @@ func SelectItemRange(items []*TrackListModel, idx int) {
}
}
func FindTrackByID(items []*TrackListModel, id string) (*mediaprovider.Track, int) {
func FindItemByID(items []*TrackListModel, id string) (mediaprovider.MediaItem, int) {
idx := slices.IndexFunc(items, func(tr *TrackListModel) bool {
return tr.Item.Metadata().ID == id
})
if idx >= 0 {
return items[idx].Track(), idx
return items[idx].Item, idx
}
return nil, -1
}