Skip to content

Commit

Permalink
Don't reload tracks if not modified
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Jun 5, 2021
1 parent f3d4d60 commit 919c5b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/list/trackslist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,14 @@ void TracksList::load(const lib::spt::playlist &playlist)
setEnabled(false);
}

spotify.playlist(playlist.id, [this](const lib::spt::playlist &loadedPlaylist)
const auto &snapshot = playlist.snapshot;
spotify.playlist(playlist.id, [this, snapshot](const lib::spt::playlist &loadedPlaylist)
{
if (snapshot == loadedPlaylist.snapshot)
{
return;
}

spotify.playlist_tracks(loadedPlaylist,
[this, loadedPlaylist](const std::vector<lib::spt::track> &tracks)
{
Expand Down

0 comments on commit 919c5b8

Please sign in to comment.