Bug 7960 - Random Plugin Not Honouring 'ADD' or 'ADD Next'
: Random Plugin Not Honouring 'ADD' or 'ADD Next'
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Playlists
: 7.0
: PC Windows XP
: -- normal (vote)
: 7.x
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-23 20:46 UTC by slav
Modified: 2009-07-31 10:20 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments
Proposed patch (1.37 KB, patch)
2008-05-08 15:17 UTC, Andy Grundman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description slav 2008-04-23 20:46:34 UTC
Steps:
1. Set Shuffle to Songs or Albums
2. play random songs/albums etc using random plugin
3. browse to song/album/artists etc and 'ADD to next' (press & hold add)
the selected music is added to next as expected
however, once the selection is finished playing (or skipping forward) the entire add next selection (be it a song or whole album etc.) is then also added to the end of the now playing list.
4. Pressing 'ADD' to add to end of playlist also does not work as expected - the song/album etc is not added to end, but some random position in the playlist
The random mix is still active & continues to work

HOWEVER: if Shuffle is off (ie Don't Shuffle Playlist) all the above 'ADDING' works as expected.

This started happening once I upgraded from 6.51 to 7.0
I have tested this on 2 separate machines, & works appropriately w/ 6.51 but not 7.0 or the 7.0.1 nightlies

This is the main way I listen to my music, so any help would be appreciated!!

thanks.
Comment 1 KDF 2008-04-28 13:04:37 UTC
Seems to be working ok here (7.0.1 svn 19214)
Comment 2 slav 2008-05-02 10:07:50 UTC
This still occurs for me with SHUFFLE ON
Just tried w/ nightly 7.0.1 19325, still happens.

thanks.
Comment 3 James Richardson 2008-05-05 09:16:16 UTC
qa to reproduce and attach logs
Comment 4 Spies Steven 2008-05-05 14:54:19 UTC
I am seeing the same behavior described by slav with SqueezeCenter 7.0.1 - 19397.

Perhaps the changes made for bug 4767 is causing this behavior.

Let me know if there are any logs I can create that would help diagnose this one.
Comment 5 Andy Grundman 2008-05-06 10:56:12 UTC
KDF, can you reproduce?
Comment 6 KDF 2008-05-06 12:46:06 UTC
as I said originally, it seems to work as I expect, at least in 7.2 (which is what I've been running of late).  I can only wonder if there is some other setting at work, but I can't see anything likely from my scans of the code.  The section of random mix that adds tracks turns shuffle off temporarily and the inserttracks command shouldn't trigger a reshuffle (let alone something that changes due to a song transition). I don't know what could be causing it.

What I have not done is try it all with 7.0.1.  I just haven't had much time. 
Comment 7 Andy Grundman 2008-05-07 09:29:18 UTC
I cannot reproduce either with 7.0.1.  Here's what I tried:

Set shuffle by song.
Started a random song mix showing the default 100 tracks.
Added a single song using hold-add.
The added song played next, and then random play continued.  The added song was not added to the end of the playlist.

I did see that when just using normal add, the track was added in a shuffled location instead of at the end.  I guess this is probably OK since you would expect a shuffled playlist.
Comment 8 Andy Grundman 2008-05-07 09:30:37 UTC
Re-assigning to QA to try to reproduce.
Comment 9 Spies Steven 2008-05-07 14:40:56 UTC
I can still easily reproduce every time with 7.0.1.

1. Start with the current playlist empty
2. Enable shuffle by song
3. Start a random song mix, mine is set to show 10 upcoming and 10 recent
4. Press and hold add on the remote to add a song as next
5. Wait for added song to to be played or skip past it

At this point what I see is that the added song is no longer above the currently playing song in the playlist but added to the bottom of the playlist to be played again.

Would any logs or screen shots help?

I will try against 7.1 and maybe 7.2.

I wonder if what hardware is playing could make a difference.  I just happen to be using a SLIMP3 doing this test.  I will try with an SB3 as well.
Comment 10 Spies Steven 2008-05-07 15:17:27 UTC
I am also able to reproduce with SB3 as well, moving on to 7.1
Comment 11 Spies Steven 2008-05-07 16:29:32 UTC
Same behavior with SC 7.1 and 7.2.
Comment 12 Andy Grundman 2008-05-08 09:54:46 UTC
OK, I was able to reproduce with Steven's instructions.  It may be that it requires a certain setting of previous/next items to occur.
Comment 13 Spies Steven 2008-05-08 09:59:55 UTC
I was also able to reproduce with 100 as well as 10 previous/next items.
Comment 14 Andy Grundman 2008-05-08 15:17:12 UTC
Created attachment 3330 [details]
Proposed patch

I think the simplest way to fix this is to short-circuit the Slim::Player::Playlist::shuffle method when RandomPlay is enabled.  This is done at least one other place (modifyPlaylistCallback) so I don't feel so bad doing it this way.  It effectively disables shuffle for the duration of a random play session, rather than just disabling it while adding more tracks.

KDF: what do you think?
Comment 15 KDF 2008-05-08 16:58:39 UTC
works for me.  seems ok even if RandomPlay is disabled.
Comment 16 Andy Grundman 2008-05-08 17:23:02 UTC
Fixed in 7.0.1 change 19572.
Comment 17 slav 2008-05-09 14:48:38 UTC
thanks everybody.
Comment 18 Ross Levine 2008-05-09 17:43:23 UTC
Verified to be fixed in 7.0.1 - 19597. 
Comment 19 James Richardson 2008-05-15 12:31:01 UTC
This bug has recently been fixed in the latest release of SqueezeCenter 7.0.1

Please try that version, if you still see the error, then reopen this bug.

To download this version, please navigate to: http://www.slimdevices.com/su_downloads.html
Comment 20 Chris Owens 2009-07-31 10:20:03 UTC
Reduce number of active targets for SC