erland wrote: > The error comes from line 1164 in Dynamic Playlist plugin code: > https://github.com/erland/lms-dynamicplaylist/blob/6a0c37c4d80e2ebeed307fc3620b757490186b76/src/Plugin.pm#L1164 > As you can see it first try to call bind_columns with three parameters > and if that fails it calls it with two. So you would get the error from > the first call but the second should succeed. If you want to get rid of > the error you will need to provide a SQL that returns three columns. The > third column should contain the first character of the second column and > is used to provide quick access to different sections of a long result > sets. I dont use the third parameter in the decades value in my > playlists since it should be a relatively short result set so no quick > navigation is needed. > > However, I dont think your issue is caused by the error message its > probably something else causing the issue ? > Have you tried enabling debug logging on plugin.dynamicplaylist in > Settings/Advanced/Logging ? You should get a log entry from line 1180 > that tells you if your SQL returns any rows: > https://github.com/erland/lms-dynamicplaylist/blob/6a0c37c4d80e2ebeed307fc3620b757490186b76/src/Plugin.pm#L1180 > You can also try your SQL in a free form query in Database Query plugin > to see if it returns the expected result. > > If you need more help I think it would be best if I could see the whole > code, could be something else than the SQL thats causing the issue.
I think there's a tiny misunderstanding the SQL code seems to be ok. It lists a list of decades to choose from. I've tried the above SQL code with SQLplaylist and DatabaseQuery and same there. Both return the decades list and SQLplaylist throws an error (only once instead of twice) but it also starts the playlist (which my plugin doesn't). So the problem/error comes when I try to act on one of these values (execute). Since the logs show that the -getNextDynamicPlayListTracks- function isn't even called yet (the error happens before) here's the content of the -getDynamicPlayLists- function for the 'rated by decade' playlist: Code: -------------------- sub getDynamicPlayLists { my ($client) = @_; my %result = (); my %playlist3 = ( 'name' => 'Rated - by DECADE', 'groups' => [['Ratings Light ']] ); my %parameter2 = ( 'id' => 2, # A number between 1-10 'type' => 'custom', 'name' => 'Select decade', 'definition' => "select cast(((tracks.year/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(((tracks.year/10)*10) as int) order by tracks.year desc" ); # PL3 my %parametersPL3 = ( 1 => \%parameter2 ); $playlist3{'parameters'} = \%parametersPL3; $result{'ratingslight_rated-by_decade'} = \%playlist3; return \%result; } -------------------- Did I screw something up in there? ------------------------------------------------------------------------ afriend's Profile: http://forums.slimdevices.com/member.php?userid=39306 View this thread: http://forums.slimdevices.com/showthread.php?t=113344
_______________________________________________ plugins mailing list plugins@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/plugins