PasTim wrote: 
> > 
Code:
--------------------
  >   > 
  > -- PlaylistName:Rated songs in classical genre
  > -- PlaylistGroups:Random/For selected
  > -- PlaylistTrackOrder:ordered
  > -- PlaylistLimitOption:unlimited
  > -- PlaylistVirtualLibraryName1:Classical
  > -- PlaylistParameter1:customgenre:Select genre:select 
id,name,substr(namesort,1,1) from genres join library_libraries on 
library_genre.library=library_libraries.library and 
library_libraries.library_name='Classical' join library_genre on 
genres.id=library_genre.genre order by genres.namesort
  > select url from
  >     (select tracks.url from tracks join library_track on
  > library_track.track = tracks.id and library_track.library = 
'PlaylistVirtualLibraryName1'
  > join genre_track on
  >                     tracks.id=genre_track.track and
  >                     genre_track.genre='PlaylistParameter1'
  >             join track_statistics on
  >                     tracks.url=track_statistics.url
  >             left join dynamicplaylist_history on
  >                     tracks.id=dynamicplaylist_history.id and 
dynamicplaylist_history.client='PlaylistPlayer'
  >             where
  >                     audio=1
  >                     and track_statistics.rating>=70
  >                     and dynamicplaylist_history.id is null
  >             group by tracks.id
  >             order by random()
  >             
  >             limit 100) as rated
  >     order by random();
  > 
--------------------
> > 
> I can 't use PlaylistVirtualLibraryName1 in the initial genre
> selection, so I had to use my new table to do it instead.  
> Note that my tracks can have multiple genres, so the Classical genres
> has many sub-genres, and in this case I don't want to see loads of
> other non-Classical genres in my selection.
> I am sure there are there are several other ways of doing this, and
> it's not a problem, more of a 'neatness' question.

You're right. DPL asks for playlist parameter input when you start a
dynamic playlist and the parameters don't know about each other.
For your use case I recommend this: DPL does actually check if there's
an *active library view/virtual library set for the player* that's
starting the dynamic playlist (it's client-specific).
So set the virtual library with all your classical music as the active
library view/virtual library for your player and then adapt your dynamic
playlist or maybe try this one:


Code:
--------------------
    -- PlaylistName:Rated songs in classical genre
  -- PlaylistGroups:Random/For selected
  -- PlaylistLimitOption:unlimited
  -- PlaylistParameter1:multiplegenres:Select genres:
  select tracks.url from tracks
        join library_track on
                library_track.track = tracks.id and library_track.library = 
'PlaylistCurrentVirtualLibraryForClient'
        join genre_track on
                genre_track.track = tracks.id and genre_track.genre in 
('PlaylistParameter1')
        join tracks_persistent on
                tracks_persistent.urlmd5 = tracks.urlmd5
        left join dynamicplaylist_history on
                tracks.id=dynamicplaylist_history.id and 
dynamicplaylist_history.client='PlaylistPlayer'
        where
                audio=1
                and tracks_persistent.rating>=70
                and dynamicplaylist_history.id is null
        group by tracks.id
        order by random()
        limit 100;
--------------------


Please note that this dynamic playlist will not work if you haven't set
a library view/virtual library for your player.
Your own playlist example calls random() 2 times. No need: just lose the
-PlaylistTrackOrder- parameter (that's for when you don't want any
randomization at all: listening to complete albums, movements...) and
DPL will add extra randomization.


PasTim wrote: 
> Yes, just the one purpose.  I just populate it using SQL, copying the
> numbers from the library prefs. ... and somehow use that in my Custom
> Browse menus.
So I don't know how exactly you use your  virtual libraries table with
CustomBrowse. But since you're obviously comfortable with SQLite I
remembered that I once had a small plugin that used custom SQLite
definitions to create virtual libraries. It kind of was the predecessor
of the more specific UseCommentTagInfo plugin. I've found a copy of
'*SQLiteVirtualLibraries*'
(https://github.com/AF-1/lms-sqlitevirtuallibraries) in my backups and
uploaded it to GitHub. Maybe check it out to see if it's of any interest
to you.



*Plugin repositories:* 'Ratings Light'
(https://github.com/AF-1/lms-ratingslight) •••• 'Visual Statistics'
(https://github.com/AF-1/lms-visualstatistics) •••• 'Use Comment Tag
Info' (https://github.com/AF-1/lms-usecommenttaginfo) •••• 'Dynamic
Playlists 3 FAQ' (https://github.com/AF-1/lms-dynamicplaylists#faq) ••••
'Custom Skip 3 FAQ' (https://github.com/AF-1/lms-customskip#faq)
------------------------------------------------------------------------
AF1's Profile: http://forums.slimdevices.com/member.php?userid=39306
View this thread: http://forums.slimdevices.com/showthread.php?t=115501

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to