Skip to content

Commit

Permalink
move refresh into AppendTracks impl
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Sep 7, 2024
1 parent 5f8f2e7 commit 65efac0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ui/widgets/tracklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,13 @@ func (t *Tracklist) GetTracks() []*mediaprovider.Track {
})
}

// Append more tracks to the tracklist. Does not issue Refresh call. Thread-safe.
// Append more tracks to the tracklist. Thread-safe.
func (t *Tracklist) AppendTracks(trs []*mediaprovider.Track) {
t.tracksMutex.Lock()
defer t.tracksMutex.Unlock()
t.tracksOrigOrder = append(t.tracks, util.ToTrackListModels(trs)...)
t.doSortTracks()
t.list.Refresh()
}

func (t *Tracklist) SelectAll() {
Expand Down
1 change: 0 additions & 1 deletion ui/widgets/tracklistloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func (t *TracklistLoader) loadMoreTracks(num int) {
return
}
t.tracklist.AppendTracks(t.trackBuffer)
t.tracklist.Refresh()
t.len += len(t.trackBuffer)
}
if t.done {
Expand Down

0 comments on commit 65efac0

Please sign in to comment.