PDA

View Full Version : Playlist Generator?



w3wilkes
2017-12-21, 21:16
I built this SQL Select that selects songs in the Tracks table of the library database. I'd like to use this to build .m3u relative directory playlists. I tried using Erland's Playlist generator plugin, but it causes the current 7.9.1 LMS on Win10 to hang. I had to use Task manager to kill LMS after I tried to use that plugin. Does anybody have a "SQLite Expert Personal" shell I could plug this Select into to generate a playlist?

select tracks.url from tracks
join genre_track on
tracks.id=genre_track.track
join genres on
genre_track.genre=genres.id
left join dynamicplaylist_history on
tracks.id=dynamicplaylist_history.id and dynamicplaylist_history.client='PlaylistPlayer'
where
audio=1
and dynamicplaylist_history.id is null
and genres.name in ('Pop/Rock','Rock','Rock & Roll','Pop')
and (tracks.bpm > 127 and tracks.bpm < 130)

DJanGo
2017-12-22, 03:09
Does anybody have a "SQLite Expert Personal" shell I could plug this Select into to generate a playlist?

select tracks.url from tracks
join genre_track on
tracks.id=genre_track.track
join genres on
genre_track.genre=genres.id
left join dynamicplaylist_history on
tracks.id=dynamicplaylist_history.id and dynamicplaylist_history.client='PlaylistPlayer'
where
audio=1
and dynamicplaylist_history.id is null
and genres.name in ('Pop/Rock','Rock','Rock &amp; Roll','Pop')
and (tracks.bpm > 127 and tracks.bpm < 130);

Hi just added that plugin and other than adding a ; at the end - its (meaning of in sqlite is a output) running fine ..

/edit
after adding the sql playlist plugin - your sql statement adds a playlist..
\edit

DJanGo
2017-12-22, 08:12
hmmm..

after fiddling around with that plugin i've set the logging for that plugin to debug


[17-12-22 15:57:07.5507] Plugins::PlaylistGenerator::ConfigManager::BasePar ser::parseContent (121) Skipping test:
[17-12-22 15:57:07.5509] Plugins::PlaylistGenerator::ConfigManager::WebAdmi nMethods::saveItem (1188) Opening configuration file: /media/music/[playlist]/demo.playlistdefinition.xml
[17-12-22 15:57:11.3107] Plugins::PlaylistGenerator::ConfigManager::BasePar ser::parseContentImplementation (501) Failed to parse configuration (test) because:
File does not exist: select tracks.url from tracks
join genre_track on
tracks.id=genre_track.track
join genres on
genre_track.genre=genres.id
left join dynamicplaylist_history on
tracks.id=dynamicplaylist_history.id and dynamicplaylist_history.client='PlaylistPlayer'
where
audio=1
and dynamicplaylist_history.id is null
and genres.name in ('Pop/Rock','Rock','Rock &amp; Roll','Pop')
and (tracks.bpm > 127 and tracks.bpm < 130) ; at /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/PlaylistGenerator/ConfigManager/BaseParser.pm line 498.


If i want to save a playlist it always ends (in the gui) with permissions denied even when the folder is owned by nouser:nogroup

sorry cant help you any further

w3wilkes
2017-12-22, 11:35
If i want to save a playlist it always ends (in the gui) with permissions denied even when the folder is owned by nouser:nogroup


Thanks, got to the point of the syntax working and debug shows all is well right up to a point. When I click Save and Generate it just stops and the WebGUI left hand frame blanks with Page not Found (404). When I look at the log (set to debug) it gives no clue as to what happened that I can see. I don't find a Playlist anywhere. Log is attached.

w3wilkes
2018-01-15, 11:43
Finally able to generate .m3u playlists that I can transfer and use on another device. However, not using Erland's Playlist Generator plugin. The Playlist Generator plugin should be banned from LMS on Windows 10 as it locks up LMS to the point that LMS must be killed with Task Manager.

I have and use Erland's SQL Playlist / Dynamic Playlist plugins. With the SQL Playlist plugin I use the same SQL script above to generate my desired playlist. Set Music Limit to 500. Then in Dynamic Playlist I set "Now Playing will show" to 500 Upcoming songs and leave "recently played" blank. Click the "+" (plus) sign to the right of the playlist I built in the SQL Playlist plugin which then loads the playlist into the right frame of the WebUI and then click the "Save" icon in the bottom right area of the WebUI. This puts the Playlist in the left hand pane and has a box to fill in the playlist name and a Save button at the top of the screen. Viola, I now have a .m3u playlist in my playlist directory with all my songs of my selected BPM's and Genre's. With some minor mass change editing to change the file locations from absolute to relative and then I have a playlist I can transfer to my Sony Walkman to take on my walk or run. Other than the root directory the album/artist/songs structure are the same as on my LMS server.

A little convoluted to get there, but it's way easier than building these type playlists manually!

Roland0
2018-01-18, 13:37
Thanks, got to the point of the syntax working and debug shows all is well right up to a point. When I click Save and Generate it just stops and the WebGUI left hand frame blanks with Page not Found (404).
Edit logitechmediaserver-7.9.1/Slim/Web/Pages.pm


require Slim::Web::Pages::Home;
# add this:
require Slim::Web::Pages::BrowseDB;
# end add
require Slim::Web::Pages::Status;
require Slim::Web::Pages::EditPlaylist;
require Slim::Web::Pages::Playlist;
require Slim::Web::Pages::Progress;
require Slim::Web::Pages::Trackinfo;
require Slim::Web::Pages::Search;

Slim::Web::Pages::Common->init();
Slim::Web::Pages::Home->init();
# add this:
Slim::Web::Pages::BrowseDB->init();
# end add

w3wilkes
2018-01-19, 11:31
Edit logitechmediaserver-7.9.1/Slim/Web/Pages.pm


require Slim::Web::Pages::Home;
# add this:
require Slim::Web::Pages::BrowseDB;
# end add
require Slim::Web::Pages::Status;
require Slim::Web::Pages::EditPlaylist;
require Slim::Web::Pages::Playlist;
require Slim::Web::Pages::Progress;
require Slim::Web::Pages::Trackinfo;
require Slim::Web::Pages::Search;

Slim::Web::Pages::Common->init();
Slim::Web::Pages::Home->init();
# add this:
Slim::Web::Pages::BrowseDB->init();
# end add


I don't understand this reply?? My squeezebox directory is "C:\Program Files (x86)\Squeezebox" and I find nothing like "logitechmediaserver-7.9.1/Slim/Web/Pages.pm" to edit.

Roland0
2018-01-19, 12:39
I don't understand this reply?? My squeezebox directory is "C:\Program Files (x86)\Squeezebox" and I find nothing like "logitechmediaserver-7.9.1/Slim/Web/Pages.pm" to edit.

I'm not familiar with LMS on Windows. On other platforms, the perl source files are installed and easily edited.
You could try a file system search for Pages.pm

w3wilkes
2018-01-19, 16:28
In searching all installed programs, let alone the Squeezebox (LMS 7.9.1*) install directory, I find no pages.pm anywhere.

mherger
2018-01-19, 23:35
> In searching all installed programs, let alone the Squeezebox (LMS
> 7.9.1*) install directory, I find no pages.pm anywhere.

On Windows all those files are bundled up into one binary. You can't
edit them. May I ask why you'd need to add that module manually? Doesn't
the plugin take care of it? In any case it should be easier to fix this
in the plugin code than in LMS itself.

--

Michael

w3wilkes
2018-01-22, 07:32
I sent a note to Erland about this being broken in his plugin, but have heard nothing. Since I've got a workaround now it isn't really critical.

Roland0
2018-01-22, 17:06
On Windows all those files are bundled up into one binary. You can't
edit them. May I ask why you'd need to add that module manually? Doesn't
the plugin take care of it?

It doesn't, that't why it's broken on versions of LMS > 04/2014 (unless UPnP is enabled, see here (https://github.com/Logitech/slimserver/commit/a20bb8ee5f753c3f67f2d1dd1d7bf84ee4c0e321#diff-6c07eb9c923b18ed6dc98d3129d43cb1))
So for those who cannot apply the fix outlined below, enabling UPnP may solve the issue (haven't tested this, though)



In any case it should be easier to fix this in the plugin code than in LMS itself.


PlaylistGenerator/Plugin.pm line 25:


# add the next line
require Slim::Web::Pages::BrowseDB;
use Slim::Utils::Prefs;


PlaylistGenerator/Plugin.pm line 98:


checkDefaults();
# add the next line
Slim::Web::Pages::BrowseDB->init() unless Slim::Web::Pages->getPageFunction( qr/^browsedb\.(?:htm|xml)/);

w3wilkes
2018-01-23, 11:06
@Roland0, I inserted your 2 lines in the plugin.pm in the Playlist Generator plugin where specified and it's now working great! THANK YOU! No need for UPnP which I have shut off in my router. For those on Windows 10, plugin.pm is located here;
C:\ProgramData\Squeezebox\Cache\InstalledPlugins\P lugins\PlaylistGenerator
and to add a BPM filter I add this following line # 14 of the generated SQL query (just before the "group by" statement);

and tracks.bpm = 126

Of course you must have BPM in your tags.