add loading indicator and err/timeout toast to Album and Playlist pages (todo: other pages)

This commit is contained in:
Drew Weymouth
2025-02-14 17:15:03 -03:00
parent e10d167350
commit 3a3774f5b6
5 changed files with 50 additions and 4 deletions
+3
View File
@@ -29,12 +29,14 @@ func NewTracklistLoader(tracklist *Tracklist, iter mediaprovider.TrackIterator)
}
t.tracklist.OnTrackShown = t.onTrackShown
t.fetching = true
t.tracklist.SetLoading(true)
go t.loadMoreTracks(25)
return &t
}
// Cancels all asynchronous loads so that they will no longer modify the tracklist.
func (t *TracklistLoader) Dispose() {
t.tracklist.SetLoading(false)
t.disposed.Store(true)
t.tracklist.OnTrackShown = nil
}
@@ -71,6 +73,7 @@ func (t *TracklistLoader) loadMoreTracks(num int) {
return
}
fyne.Do(func() {
t.tracklist.SetLoading(false)
t.tracklist.AppendTracks(t.trackBuffer)
t.len += len(t.trackBuffer)
})