Version: 2.4-GIT (using KDE 4.6.0)
If "Stop playing after this track" is selected, then the scores are updated incorrectly.
This happens because in this case, both slotAboutToFinish() and (shortly after) slotFinished() are called in EngineController. Each of them calls m_currentTrack->finishedPlaying causing the score to get updated twice (which shouldn't happen because of the incremental way the score is computed). Moreover, the second time around the playedFraction is incorrectly determined to be zero which causes the overall decrease in score.
Steps to Reproduce:
Play a song, select "Stop playing after this track", and wait until it is completely played (or skip to the end). Let's assume the track has a playcount of 9 and a score of 96.
The song now has a score of 87.
(In the first step it gets a score of (9*96+100)/10 = 96 as it should, but then this is decreased to (10*96+0)/11 = 87.)
The song should get a score of (9*96+100)/10 = 96.4.
OS: Linux (x86_64) release 2.6.35-25-generic
Ouch, confirmed in current git
Git commit ee4cb2b3c72880a9a4da83756770fcd0298bedc8 by Sergey Ivanov.
Committed on 09/02/11 at 13:32.
Pushed by ivanov into branch 'master'.
Fixed track's statistics update in case of StopAfterCurrent playback mode (prevent double statistics change).
M +2 -0 ChangeLog
M +0 -4 src/EngineController.cpp
Many thanks for the quick attention!
I haven't had time to actually test the proposed fix, but it seems to me that it has a troublesome side effect: in case, a song is manually stopped by the user (so that slotAboutToFinish isn't called) the score is not going to be updated at all. Or am I missing something?
When you stop track manually, Amarok calls stop() method which updates track statistics.