Currently we just scroll to the last viewed index of the last playlist in the new one. This makes no sense and is frustrating when switching between long and short playlists.
This change scrolls to the last played track in each playlist on transition.
Fixes#4836
Last.fm defines a scrobble should be sent if:
-the track is longer than 30 seconds.
-the track has been played for at least half its duration, or for 4 minutes (whichever occurs earlier.)
Clementine has treated this as seconds from the start of the track, and if any seeking occurs, it nullifies the scrobble.
This IMO is incorrect. If I skip the first 10 seconds of a song, but listen to the rest (still meeting the time requirements),
I should still be able to scrobble the play. This change moves the scrobble point with every seek, requiring continuous playback
from any point that satisfies the time criteria.
Otherwise, it was never set to false at startup if no "current_playlist" was saved in the settings, then there was no new value saved for "current_playlist".
Fixes#4011.
When starting clementine, each playlist is loaded in turn.
When loading a playlist, the new tab order is committed to the db,
but we don't need to do that here because we know that once all the
playlists are loaded the tab order will be the same as it was initially.
This speeds startup substantially.
kstartperf:
Before: 3.5s
After: 1.5s
The playlist fetching uses QtConcurrent to make the playlist on a
different thread (possibly concurrently for each item).
However, profiling reveals that the slow operation is fetching
the rows from the SQLite database, making this redundant.
Instead move the whole playlist loading, including the database access,
into a single function, and call that function in a different thread via
QtConcurrent::run.
This has the side effect of moving all the concurrent stuff from
PlaylistBackend into the callers.
kstartperf measures:
Before: 7.5s cold
3.6 s warm
After: ~4.0 s cold
3.5 s warm
This is less confusing IMO. The dialog will shown up only if users decided to in the preferences, so that will not bother users who don't need this.
This reuses lot of things from Alan contribution from #4484