Bug 240452

Summary: [PATCH]"Random tracks" mode always starts at first track
Product: [Applications] amarok Reporter: Job Noorman <job>
Component: PlaylistAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: anton, nhn, teo
Priority: NOR    
Version: 2.3.1-GIT   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 2.3.2
Attachments: Try this patch, please

Description Job Noorman 2010-06-02 12:05:58 UTC
Version:           2.3.0 (using KDE 4.4.2) 
OS:                Linux

When loading an new playlist when nothing is currently playing and "Track progression" is set to "Random tracks", Amarok always starts playing the first song in the playlist.

Reproducible: Always

Steps to Reproduce:
1) Make sure no track is currently playing
2) Set "Track progression" to "Random tracks"
3) Load a new playlist

Actual Results:  
Amarok always starts playing the first track in the new playlist.

Expected Results:  
Amarok should pick the first track to play at random.

Using Kubuntu 10.04
Comment 1 Anton Gritsay 2010-07-08 19:42:10 UTC
Can not reproduce it with 2.3-git.
Comment 2 Myriam Schweingruber 2010-07-09 11:03:51 UTC
Anton, thank you for the feedback, I mark this as fixed, feel free to reopen the report if you can reproduce this with the upcoming Amarok 2.3.2 or a current 2.3.1-git version
Comment 3 Job Noorman 2010-07-11 12:58:37 UTC
I just built Amarok from git and I still experience the exact same issue so I will reopen this report.

Please let me know if I can give any additional info that will help you pinpoint the issue.
Comment 4 Anton Gritsay 2010-07-11 13:54:27 UTC
I'm sorry, I've found a way to reproduce bug. I tried to set playlist by drag-n-drop from the collection (play not starts, so everything is ok). Bug is reproducible if user use context-menu on the playlist object in the collection.
Comment 5 Anton Gritsay 2010-07-11 13:55:14 UTC
Created attachment 48779 [details]
Try this patch, please
Comment 6 Job Noorman 2010-07-12 09:03:28 UTC
Thanks Anton, your patch fixes the problem.
Comment 7 Anton Gritsay 2010-07-12 09:10:43 UTC
I think the bugreport should not be closed until the bug is fixed in mainline. This patch is not yet in master.
Comment 8 Job Noorman 2010-07-12 10:44:21 UTC
Woops sorry about that. Reopened it.
Comment 9 Nikolaj Hald Nielsen 2010-07-13 09:14:16 UTC
Some bugzilla username foo made the fix not show up automatically!

commit f99654fcacd7e0ebdf8f0b0a3e8be1d4ea4b00f2
Author: Nikolaj Hald Nielsen <nhnFreespirit@gmail.com>
Date:   Mon Jul 12 23:44:08 2010 +0200

    Fix always playing first track when adding tracks to empty playlist with random mode on
    Thanks to Anton Gritsay <anton@angri.ru> for another fine patch! :-)
    BUG: 240452