Bugzilla – Bug 3297
Random play always continues in random song mode after restart
Last modified: 2011-11-06 23:23:08 UTC
When the server was in random album mode and is stopped (shut down) and started again, it will continue with the play list, but change to random song mode. So as soon as new titles are added to the playlist (since all the remaining songs were played), this is done in random song mode, not in random album mode.
HEre is my idea: change the current pref 'plugin_random_keep_adding_tracks', and have it store 0,1,tracks,album,artist as values. This way, the last selected mode can be persistent over server restarts. On startup, a callback is created to watch for track change. This calls playRandom no matter what. I'd like to change this to check the pref before calling playRandom. This way, if the pref is 0, nothing happens. If the pref is 1 or "track" then we add a track. If the pref is 'album' or 'artist' then we can call playRandom with that mode. If that sounds like the right way to go, I can create and test a patch tonight.
oh, just looked at the history of the plugin. It looks like pre-svn6002 the plugin would be disabled after restart (by checking $type{client} at line 529. To do the same thing, this was converted to: if (!defined $client || !defined $mixInfo{$client}) { However, %mixinfo is used for type, and starttime per client. Thus, to check type it should be: if (!defined $client || !defined $mixInfo{$client}->{'type'}) { I guess it just depends on whether Rancom play should persist across restarts or not.
Dean - thoughts?
applied above fix to trunk at change 7412 since it was also needed for bug 3415. Marking as an enhancement at this point, since the option to have the random mode persist over restarts would appear to be a design change. The fix should effectively avoid the switch to track mode on startup, and would match previous code that would have done nothing on a server restart.
*** Bug 4838 has been marked as a duplicate of this bug. ***
Unassigned bugs cannot have a priority.