Marc Sherman;210293 Wrote: 
> 
> 1) How do I tell it to just play a single random album, instead of
> always adding another album to the end of the list when there's less
> than 10 tracks left?
> 
If you choose to customize the SQL and enter a playlist that looks like
this it will only play a random album:

Code:
--------------------
    
  -- PlaylistName:Random album
  -- PlaylistGroups:
  -- PlaylistOption Unlimited:1
  -- PlaylistOption ContentType:album
  select tracks.album from tracks
        join genre_track on
                tracks.id=genre_track.track
        join genres on
                genre_track.genre=genres.id
        where
                audio=1
                and genres.name in ('Lullaby')
                and 1>(select count(distinct tracks.album) from 
dynamicplaylist_history,tracks where 
                                        tracks.id=dynamicplaylist_history.id)
        group by tracks.album
        order by rand()
        limit 1;
  
--------------------


Marc Sherman;210293 Wrote: 
> 
> 2) Am I correct in thinking that a PlaylistStopAction1:cli: parameter
> can be used to shut off the squeezebox at the end of the playlist?
> 
Theoretically you should be able to add an option like this in the
playlist:

Code:
--------------------
    
  -- PlaylistStopAction1:cli:power 0
  
--------------------

Unfortunately this doesn't work at the moment for two reasons:

- Reason 1: 
There is a bug which results in that stop actions only are executed
when you stop the playlist by doing something with the remote/web
inteface, but not when the playlist is stopped because it reaches the
end. This is a bug and will be corrected in the next version of
DynamicPlayList.

- Reason 2:
DynamicPlayList leaves the control to SlimServer when it can't find any
more tracks. This will happen when there is less than 10 tracks left in
the playlist and it detects that more tracks should be added, so it
will happen before the album has finished playing.

One idea is to use the "sleep" command instead and issue the sleep
command as a start action with the number of seconds until sleep as
parameter. This would result in something like this with sleep after
1800 seconds:

Code:
--------------------
    
  -- PlaylistName:Random album and sleep
  -- PlaylistGroups:
  -- PlaylistOption Unlimited:1
  -- PlaylistStartAction1:cli:sleep 1800
  -- PlaylistOption ContentType:album
  select tracks.album from tracks
        join genre_track on
                tracks.id=genre_track.track
        join genres on
                genre_track.genre=genres.id
        where
                audio=1
                and genres.name in ('Lullaby')
                and 1>(select count(distinct tracks.album) from 
dynamicplaylist_history,tracks where 
                                        tracks.id=dynamicplaylist_history.id)
        group by tracks.album
        order by rand()
        limit 1;
  
--------------------


I'll add an entry on the wish list to allow commands to be executed
after the last track has actually been played.


-- 
erland

Erland Isaksson
'My homepage' (http://erland.homeip.net) 'My download page'
(http://erland.homeip.net/download)
(Developer of 'TrackStat, SQLPlayList, DynamicPlayList, Custom Browse,
Custom Scan,  Custom Skip, Multi Library and RandomPlayList plugins'
(http://wiki.erland.homeip.net/index.php/Category:SlimServer))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=36306

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to