![]() Registered Member ![]()
|
hi,
i've written a small perl script that i used to convert my old amarok 1.4 playlist (from "current.xml") to a new amarok 2.1 svn installation with the new playlist format because the new amarok didn't seem to load my old playlist. the script fetches the "amarok-sqltrackuid" from the mysql embedded database with the path/url info from the old current.xml playlist and then outputs the new xspf format (to STDOUT). hence it needs mysqld running, see http://amarok.kde.org/wiki/Development/MySQL_Embedded#Tips. it will also show the entries that couldn't be converted (to STDERR). i've installed 2.1-svn from scratch with a new config and new collectionscan (same files) and didn't import anything from the old amarok. my script successfully converted my old playlist and only skipped 32 out of 277 entries which the new amarok didn't seem to add to the collection database (don't know why..). usage example: convert.pl /path/to/old/amarok/current.xml > ~/.kde4/share/apps/amarok/current.xspf (backup old file!) DISCLAIMER: it works for my setup and it is possible that it won't for yours. backup your amarok stuff before trying. feel free to reuse or change the code if it doesn't work you. i didn't test it with v2.0.2, it may work ![]() [edited 20090416] i've removed the code as it seems some users had problems with copy&paste from the forum. i've uploaded the script as convert.pl.txt, just rename the file to convert.pl and it should work then. furthermore the script has to be run from commandline (konsole, ...), it is not a amarok script. [/edited 20090416] 20090418: uploaded v0.4
Last edited by 0x00 on Sat Apr 18, 2009 2:46 pm, edited 1 time in total.
|
![]() KDE Developer ![]()
|
Thanks for this contribution
![]() It's probably going to make many users happy.
--
Mark Kretschmann - Amarok Developer |
![]() Registered Member ![]()
|
hi,
i've adjusted the script (v0.3) and now it should also be able to convert playlists with streams or other URLs instead of only handling local "file://" URIs. i didn't fully test it (only modified my old playlist) as i don't have a playlist from amarok 1.4 with streams/podcasts (only local mp3s). 0x00 |
![]() Registered Member ![]()
|
I am having some problems getting it to work, I keep getting syntax errors.
Any suggestions? |
![]() Registered Member ![]()
|
i think it is [......] well.. i can't know what went wrong, i need more info, maybe you could post how you started the script, maybe it was a copy&paste error (check with perl -c yourfile.pl) , post what the output (error) is, or does the conversion work and amarok complains ... you can also upload your xml-playlist somewhere so i can take a look whether it has some weird format, ..... ![]() 0x00
Last edited by 0x00 on Thu Apr 16, 2009 3:35 pm, edited 1 time in total.
|
![]() Registered Member ![]()
|
I don't really know where I could upload it, but this is what I get when I run it.
I also tried in the scripting consol in amarok, but it ust said syntax error. Here's what is in the file
|
![]() Registered Member ![]()
|
hi,
i've rewritten my script (v0.4), and it is also able to import .m3u playlists now. i've added the script to the first post. the new script handles .m3u playlist files and inserts them into the mysqld of amarok. it searches for the paths of the m3u tracks in the database, retrieves the collection path stored in the database and uses that path instead of the one in the .m3u playlist. this is because at least my old amarok m3u playlists often had relative paths which don't seem to be working 1:1 in new amarok anymore. keep in mind that it if you add a m3u playlist and the track is NOT in the collection it will be added to the playlist database anyway BUT it may not be recognized by amarok if it has a relative path that is inside your home directory (such as ../../../../../mp3/somefile.mp3). in that case you'd have to change the relative paths to absolute ones. i didn't want to mess further with paths in that case. 0x00 |
![]() KDE Developer ![]()
|
How about putting it on kde-apps.org? This way you'd have proper hosting for free, and it would make it easier to find for others. PS: Please don't put it in the "Amarok Scripts" category though, which is reserved for scripts that run with Amarok's Script Manager system.
--
Mark Kretschmann - Amarok Developer |
![]() Registered Member ![]()
|
finally got to a point where I could give it a shot. It keeps erroring out saying mysqld is not runing. |
![]() Registered Member ![]()
|
as new playlists are being stored in the embedded mysqld for amarok2, mysqld has to be running, see my first post how to do start it (link on the amarok wiki).
at my system it is enough to run as your user (you may have to adjust the permissions for the socket directory):
0x00 |
![]() Registered Member ![]()
|
I know I must be completely missing something, but I just can't figure this out. *WHERE* can I find the script? v 0.3 used to be in the first entry in this thread. That was removed when 0.4 was released. The post says that it was "uploaded," but not where it was uploaded *TO*. I really want to get my hands on a copy of v 0.4 of this script. Can anyone tell me where I can locate it? Or can someone send me a copy?
- Biffster |
![]() Registered Member ![]()
|
it seems the forum has moved (haven't been here for a while..). the old forum had a file upload feature and i've uploaded it there. since i can't find any way to upload files at the new forum (i tried sending you a pm with an attachment, but it always denied the file extension). hence i've pasted the contents of the perl script here: http://pastebin.com/f7526107d
i have no idea whether the script still works for the latest version and i also don't have time to take a look ![]() 0x00 |
![]() Manager ![]()
|
You should upload it to http://kde-apps.org/index.php?xcontentmode=57, that's where the Amarok 2.x scripts all are
![]()
Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ... |
![]() Registered Member ![]()
|
Thank you so much!!!! ![]() |
![]() Administrator ![]()
|
@0x00: File attachments are disabled here for security reasons.
Unfortunately we were unable to import the attachments, as they had been given odd names by the previous board making it impossible for us to script the importing of them.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]