News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

Import playlists (m3u)?

Started by dothedog, May 22, 2011, 06:38:22 PM

Previous topic - Next topic

dothedog

I have seen a few old references to some work done on importing m3u playlists, e.g. here:
http://forum.linuxmce.org/index.php?topic=5803.0

and I noticed that there is an "Export" button in the webadmin. I am still looking for an "import" function. I have a few playlists that are pretty large, but are in m3u format. Barring a "button", can this be done in mysql? I looked at the PlaylistEntry table and the only thing I couldn't figure out was the FK_File. Where is that number located? Any thoughts on a stand alone script to build a Playlist?

Dothedog

Marie.O

you have to write a script, that references the entries in the m3u file with the entries in the table File of LinuxMCE. After doing that, create the necessary entries into the Playlist table prefixing the found PK_File number with F
If I helped you, feel free to buy me a coffee: [url="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES"]https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES[/url]

dothedog

posde,
Thanks for the reply. I understand what has to happen with the script, parse the records, look up  PK_File in File then insert t all into PlaylistEntry. I am afraid however it is beyond my scripting foo skills. Has someone written something that I can edit ?

DoTheDog

Marie.O

No such script exists at the moment.

And I am sure, you will be fine doing it. Take one step at a time, search the web, I am sure lots of scripts already exist to parse a m3u file from bash or perl or python or whatnot. start little, and let it grow
If I helped you, feel free to buy me a coffee: [url="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES"]https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES[/url]

purps

This is something that I would be interested in also - I have extensive playlists on a separate ubuntu desktop that I would like to import into LMCE.

I understand an .m3u file is essentially just a list of paths, correct? Would the script need to replace this path with "/mnt/device/76/public/data/music" or whatever, or would the script only be interested in the last part i.e. the filename?

dothedog, do you want to get together on IRC at some point and attempt this together? My scripting skills aren't amazing, but two heads will be better than one.

Cheers,
Matt.
1004 RC :: looking good :: upgraded 01/04/2013
my setup :: [url="http://wiki.linuxmce.org/index.php/User:Purps"]http://wiki.linuxmce.org/index.php/User:Purps[/url]

Marie.O

You need to find out, where the file is in the LinuxMCE hierarchie, to find its PK_File ID. The Playlist table only cares about the PK_File
If I helped you, feel free to buy me a coffee: [url="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES"]https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2VKASZLTJH7ES[/url]