>Can you release your revised code for review and explain your comments
>regarding unsafe.  I assume you refering to the unique array?  Which is
>used temporarily during the selection and then wiped once the track is
>selected.  I think it would be pretty impressive if this caused an issue
>in use but happy to be proved wrong.

Thanks for releasing your update to this plugin - it is most appreciated.  
Sorry if I sounded ungrateful - I was just trying to help, and I seem to be one 
of minority that use it with DynamicPlaylists.  I realise that this part of 
your plugin was not really being maintained; I didn't want to make it sound 
like I thought it wasn't very good.

@unique is used within commandCallback when processing a newsong event, and 
also getNextDynamicPlayListTracks.  The code writes to the array, processes it, 
and then clears it.  I was thinking that there could be some time between 
writing the array and clearing it, that some other player that is also 
processing a newsong/DynamicPlaylist event would be in contention with that 
data.  However, if the server is all single-threaded (another player event not 
being processed until the first command callback has finished being processed), 
then I guess it's safe.  In other cases, data from functions is returned and 
then passed them into other functions, rather than using a global variable, so 
I just thought at first glance that it looked like a problem.

I've seen a few unexplained occurances in the past where it's stopped queuing 
up songs for no reason (pressing play on the same track then causes a new track 
to start), but that was with a previous version of the plugin.  This is the 
first time I've looked at the code though (because I wanted to get 
DynamicPlaylist processing working again).  I wasn't really looking for other 
issues, but it was just a passing thought when I was trying to understand how 
it worked, that it looked unsafe (could return the unique array instead of 
diditwork indicator - empty array=not worked).

I haven't done a diff to see what changes I actually made in the end.  I played 
around quite a bit with debug statement changes to understand how it worked 
(moved some code around, then moved it back!); I think the changes to get it to 
work were actually minimal.

I've tried SugarCube in it's usual playback mode since making the changes, and 
it still seems to work, but haven't done extensive testing (eg. haven't looked 
to see if remembered tracks is working to remove played tracks from future 
choices).  I cleared my prefs file down to start afresh - not sure what would 
happen with existing prefs file.
_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to