Bug 188360

Summary: Random Playlist Proportional Bias "Play Count less than 3" not working 100%
Product: [Applications] amarok Reporter: Stefan Becker <chemobejk>
Component: Playlists/Dynamic PlaylistsAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED LATER    
Severity: normal CC: danielcjones, lamarque, mikko.cal, ralf-engels, wshambaugh
Priority: NOR    
Version: 2.4.0   
Target Milestone: 2.4.0   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Stefan Becker 2009-03-28 21:05:36 UTC
Version:           2.0.2 (using KDE 4.2.1)
OS:                Linux
Installed from:    Fedora RPMs

I have the following Random Playlist configured:

  Proportional Bias
  Proportion: 100%
  Match:      Play Count
  With:       less than 3

So I would expect that all tracks that are added to the playlist must have a Play Count 0, 1 or 2. For most tracks that is done correctly, but sometimes a track with Play Count 3 or higher ends up on the list.

This is reproducible.
Comment 1 Mikko C. 2009-03-28 21:11:21 UTC
My situation is slightly different.
I have a dynamic playlist with multiple 0% biases to match specific Tags (music I really don't want to end up in the playlist).

It works most of the time, but sometimes I a track with those specific Tags end up in the playlist anyway.
Comment 2 Stefan Becker 2009-05-12 07:22:15 UTC
I have monitored the behaviour for some time now. My conclusions: the playlist filter (Playcount < 3) seems to work correctly BUT only if the item added has not been played before in the same session. All the wrong entries that shouldn't have been added had been played before in the same Amarok session.

My theory: Amarok keeps the state of a song cached in memory. When a song is played its statistics in the database are updated correctly (playcount = N + 1) BUT the state in memory is not (playcount = N). The playlist filter (playcount < N + 1) is looking at the cached state and not the database and therefore re-adds the song to the playlist.
Comment 3 Stefan Becker 2009-06-19 16:40:32 UTC
Confirmed: bug still exists in release version of Amarok 2.1
Comment 4 Myriam Schweingruber 2009-08-02 16:27:22 UTC
Any news on this?
Comment 5 Myriam Schweingruber 2009-11-04 00:36:05 UTC
Changing version and target *sigh*
Comment 6 Myriam Schweingruber 2009-12-06 14:09:08 UTC
*** Bug 217483 has been marked as a duplicate of this bug. ***
Comment 7 Lamarque V. Souza 2010-06-04 04:29:22 UTC
Still happens with 2.3.1. It is very strange, using the same criteria in bug description it always adds 10 songs *randomly*. Everytime I run the 10 songs are different and all of them with more than three execution. Just as to know, my Amarok is localized into Brazilian Portuguese, does the localition interfere in the search criteria?
Comment 8 Myriam Schweingruber 2010-06-05 01:32:49 UTC
Lamarque, please do not confirm bugs labeled for Git with a stable version, git is the latest development version and is ahead of the released versions..
Comment 9 Lamarque V. Souza 2010-06-05 01:47:57 UTC
Why not? This is around for more than one year since 2.0.2 at least. I am just inform you that there is people here complaning about a bug that should have been fixed months ago. Just saying to wait is not gonna fix it.
Comment 10 Myriam Schweingruber 2011-04-03 17:01:24 UTC
What is the state of this bug in Amarok 2.4 or 2.4. beta 1?
Comment 11 Stefan Becker 2011-04-03 17:43:11 UTC
The major problems have been fixed, e.g. that the dynamic play list definitions weren't stored at all. So currently such a dynamic play list behaves correctly most of the time.


But once in a while it still adds a song incorrectly:

  - comment #2 is still valid. 

  - Amarok can't handle exhaustive dynamic play list definitions. "playcount < N" is an exhaustive definition, i.e. after each song has reached playcount = N, such a dynamic play list SHOULD NOT add any songs any more and Amarok should stop playing when the end of the play list is reached.


The test case for the scenario is pretty simple: create a collection with 10 titles, a play list length of 5 and a dynamic play list definition "playcount < 1".
Comment 12 Myriam Schweingruber 2011-04-04 00:45:26 UTC
Thank you for the feedback. Setting current version to 2.4
Comment 13 Ralf Engels 2011-05-27 20:01:20 UTC
The new dynamic bias implementation improves this behaviour.

However it still does not treat track statistics that will change during a playback correctly if the track is in the playlist several times.

e.g. this playlist:
Bad: playcount 1, last played 1 week ago
Thriller: playcount 0, last played never
Bad: And now the track should be handled as playcount 2, last played 5 minutes ago