afriend wrote: 
> With *year* you'll have to choose a year. Not optional.
> 
> > 
Code:
--------------------
  >   > -- PlaylistName:Songs - multiple genres & year   (from selected 
playlist)
  > -- PlaylistGroups:
  > -- PlaylistMenuListType:contextmenu
  > -- PlaylistParameter1:playlist:Select playlist:
  > -- PlaylistParameter2:multiplegenres:Select genres:
  > -- PlaylistParameter3:year:Select year:
  > select distinct playlist_track.track from playlist_track
  >     join tracks on
  >             tracks.url = playlist_track.track
  >     join genre_track on
  >             genre_track.track = tracks.id and genre_track.genre in 
('PlaylistParameter2')
  >     left join dynamicplaylist_history on
  >             dynamicplaylist_history.id=tracks.id and 
dynamicplaylist_history.client='PlaylistPlayer'
  >     where
  >             playlist_track.playlist='PlaylistParameter1'
  >             and tracks.year='PlaylistParameter3'
  >             and tracks.audio = 1
  >             and tracks.secs >= 'PlaylistTrackMinDuration'
  >             and dynamicplaylist_history.id is null
  >     group by playlist_track.track
  >     order by random()
  >     limit 'PlaylistLimit';
  > 
--------------------
> > 
> 
> With *decades* it's optional (select -any-).
> 
> > 
Code:
--------------------
  >   > -- PlaylistName:Songs - multiple genres & decade   (from selected 
playlist)
  > -- PlaylistGroups:
  > -- PlaylistMenuListType:contextmenu
  > -- PlaylistParameter1:playlist:Select playlist:
  > -- PlaylistParameter2:multiplegenres:Select genres:
  > -- PlaylistParameter3:customdecadechained:Select decade:select 
cast(((ifnull(tracks.year,0)/10)*10) as int),case when tracks.year>0 then 
cast(((tracks.year/10)*10) as int)||'s' else 'Unknown' end from tracks where 
tracks.audio=1 group by cast(((ifnull(tracks.year,0)/10)*10) as int) order by 
tracks.year desc
  > select distinct playlist_track.track from playlist_track
  >     join tracks on
  >             tracks.url = playlist_track.track
  >     join genre_track on
  >             genre_track.track = tracks.id and genre_track.genre in 
('PlaylistParameter2')
  >     left join dynamicplaylist_history on
  >             dynamicplaylist_history.id=tracks.id and 
dynamicplaylist_history.client='PlaylistPlayer'
  >     where
  >             playlist_track.playlist='PlaylistParameter1'
  >             and tracks.year='PlaylistParameter3'
  >             and tracks.audio = 1
  >             and tracks.secs >= 'PlaylistTrackMinDuration'
  >             and dynamicplaylist_history.id is null
  >             and
  >                     case
  >                             when 'PlaylistParameter3'!=999999999 then 
tracks.year>='PlaylistParameter3' and tracks.year<('PlaylistParameter3'+10)
  >                             else 1
  >                     end
  >     group by playlist_track.track
  >     order by random()
  >     limit 'PlaylistLimit';
  > 
--------------------
> > 
> 
> And without year/decade:
> 
> > 
Code:
--------------------
  >   > -- PlaylistName:Songs - multiple genres   (from selected playlist)
  > -- PlaylistGroups:
  > -- PlaylistMenuListType:contextmenu
  > -- PlaylistParameter1:playlist:Select playlist:
  > -- PlaylistParameter2:multiplegenres:Select genres:
  > select distinct playlist_track.track from playlist_track
  >     join tracks on
  >             tracks.url = playlist_track.track
  >     join genre_track on
  >             genre_track.track = tracks.id and genre_track.genre in 
('PlaylistParameter2')
  >     left join dynamicplaylist_history on
  >             dynamicplaylist_history.id=tracks.id and 
dynamicplaylist_history.client='PlaylistPlayer'
  >     where
  >             playlist_track.playlist='PlaylistParameter1'
  >             and tracks.audio = 1
  >             and tracks.secs >= 'PlaylistTrackMinDuration'
  >             and dynamicplaylist_history.id is null
  >     group by playlist_track.track
  >     order by random()
  >     limit 'PlaylistLimit';
  > 
--------------------
> > 

I tried these out and it appears that there is either a flaw in the code
or a bug in the plugin. 

With the "multiple genres/select decade" playlist, it selected only 9
songs in spite of there being hundreds that would have qualified. All of
the 9 songs were from 1960, in spite of having selected that entire
decade of the '60s. When I tried a second time, the exact same 8 songs
came up.

With the "multiple genres/select year" playlist, the songs seemed like
they were correct, though not as shuffled as I might have wanted, but
ended after several hours of play, when there should have been enough
songs to last all day. The big tipoff was no Beatles included when Rock
and Roll was one of the selected genres and 1967 was the selected year.

Any thoughts?


------------------------------------------------------------------------
nyindieguy's Profile: http://forums.slimdevices.com/member.php?userid=62092
View this thread: http://forums.slimdevices.com/showthread.php?t=115501

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

Reply via email to