wip restore queues on start

This commit is contained in:
Siiiiinth
2026-02-09 08:09:01 +01:00
parent 2d29b7f271
commit 48226d5461
10 changed files with 101 additions and 61 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
go a.page.pm.PlayAlbum(a.page.albumID, 0, false)
})
shuffleBtn := widget.NewButtonWithIcon(lang.L("Shuffle"), myTheme.ShuffleIcon, func() {
a.page.pm.LoadTracks(a.page.tracklist.GetTracks(), backend.Replace, true)
a.page.pm.LoadTracks(a.page.tracklist.GetTracks(), backend.Replace, backend.Both, true)
a.page.pm.PlayFromBeginning()
})
var pop *widget.PopUpMenu
+1 -1
View File
@@ -98,7 +98,7 @@ func (a *FavoritesPage) createHeader(activeBtnIdx int) {
widget.NewButtonWithIcon("", myTheme.TracksIcon, a.onShowFavoriteSongs))
a.shuffleBtn = widget.NewButtonWithIcon(lang.L("Shuffle"), myTheme.ShuffleIcon, func() {
if tr := a.tracklistOrNil(); tr != nil {
a.pm.LoadTracks(tr.GetTracks(), backend.Replace, true /*shuffle*/)
a.pm.LoadTracks(tr.GetTracks(), backend.Replace, backend.Both, true /*shuffle*/)
a.pm.PlayFromBeginning()
}
})
+4 -4
View File
@@ -159,18 +159,18 @@ func NewNowPlayingPage(
a.relatedList.OnSetRating = a.queueList.OnSetRating
a.relatedList.OnSetFavorite = a.queueList.OnSetFavorite
a.relatedList.OnPlayItemAt = func(idx int) {
a.pm.LoadTracks(a.related, backend.Replace, false)
a.pm.LoadTracks(a.related, backend.Replace, backend.Both, false)
a.pm.PlayTrackAt(idx)
}
a.relatedList.OnAddToQueue = func(items []mediaprovider.MediaItem) {
a.pm.LoadItems(items, backend.Append, false)
a.pm.LoadItems(items, backend.Append, backend.Both, false)
}
a.relatedList.OnPlaySelection = func(items []mediaprovider.MediaItem, shuffle bool) {
a.pm.LoadItems(items, backend.Replace, shuffle)
a.pm.LoadItems(items, backend.Replace, backend.Both, shuffle)
a.pm.PlayFromBeginning()
}
a.relatedList.OnPlaySelectionNext = func(items []mediaprovider.MediaItem) {
a.pm.LoadItems(items, backend.InsertNext, false)
a.pm.LoadItems(items, backend.InsertNext, backend.Both, false)
}
a.relatedList.OnPlaySongRadio = func(track *mediaprovider.Track) {
go func() {
+2 -2
View File
@@ -348,11 +348,11 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
})
a.editButton.Hidden = true
playButton := widget.NewButtonWithIcon(lang.L("Play"), theme.MediaPlayIcon(), func() {
a.page.pm.LoadTracks(a.page.tracks, backend.Replace, false)
a.page.pm.LoadTracks(a.page.tracks, backend.Replace, backend.Both, false)
a.page.pm.PlayFromBeginning()
})
shuffleBtn := widget.NewButtonWithIcon(lang.L("Shuffle"), myTheme.ShuffleIcon, func() {
a.page.pm.LoadTracks(a.page.tracks, backend.Replace, true)
a.page.pm.LoadTracks(a.page.tracks, backend.Replace, backend.Both, true)
a.page.pm.PlayFromBeginning()
})