LinuxMCE Forums
May 22, 2013, 12:15:33 am GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
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
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Import playlists (m3u)?  (Read 680 times)
dothedog
Veteran
***
Posts: 82


View Profile
« on: May 22, 2011, 05:38:22 pm »

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
Logged
posde
Administrator
LinuxMCE God
*****
Posts: 2621


Wastes Life On LinuxMCE Since 2007


View Profile WWW
« Reply #1 on: May 22, 2011, 07:24:11 pm »

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
Logged

dothedog
Veteran
***
Posts: 82


View Profile
« Reply #2 on: May 23, 2011, 12:32:27 am »

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
Logged
posde
Administrator
LinuxMCE God
*****
Posts: 2621


Wastes Life On LinuxMCE Since 2007


View Profile WWW
« Reply #3 on: May 23, 2011, 06:42:03 am »

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
Logged

purps
NEEDS to work for LinuxMCE
***
Posts: 1269


If it ain't broke, tweak it


View Profile
« Reply #4 on: May 24, 2011, 01:44:28 pm »

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.
Logged

1004 RC :: looking good :: upgraded 01/04/2013
my setup :: http://wiki.linuxmce.org/index.php/User:Purps
my blog :: http://projectsofmatt.wordpress.com/
posde
Administrator
LinuxMCE God
*****
Posts: 2621


Wastes Life On LinuxMCE Since 2007


View Profile WWW
« Reply #5 on: May 24, 2011, 01:46:29 pm »

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
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!