| Re: Re: Re: how to use addMedia?? Nov 19 2010 on content Intelligent Playlist | Hm... AFAIK the above code should work out-of-the-box (and for me it does; I didn't import packages in Script Console and the example still works flawlessly).
Which version of Amarok do you use? I remember there were some issues with my plugin, too. For me, I once added the "file://" prefix to the rpath. However, in recent versions, Amarok stopped accepting these. I do not really remember, but if your Amarok is a bit older, try adding the "file://" prefix, too.
Finally, I also recommend contacting the Amarok developers (see http://amarok.kde.org/en/contribute). They surely know more about the issue than I do. |
| ![.](/img/trans.gif) | | Re: how to use addMedia?? Nov 19 2010 on content Intelligent Playlist | Hey,
the following works for me:
var songs = Amarok.Collection.query( "SELECT rpath FROM urls LIMIT 10;" );
for ( var i in songs ) {
var path = songs[ i ];
Amarok.Playlist.addMedia( new QUrl( path ) );
}
That's all. You can use Amarok's built-in Script Console for testing (go to the script manager and check the "Amarok Script Console" entry).
I don't know what you already tried, however: Amarok's database tables are pretty good normalized, i.e. the table tracks contains only some rare data. The url field indeed contains a "pointer" to an entry in the urls table. So you have to use joins to get the data. Consider the following example:
You have the ID of a track you want to add to the playlist. Then your query could look like this:
var id = 321;
var url = Amarok.Collection.query( "SELECT url.rpath FROM tracks AS track INNER JOIN urls AS url ON track.url = url.id WHERE track.id = " + id + ";" );
Amarok.Playlist.addMedia( new QUrl( url[ 0 ] ) );
Okay, I hope this helps so far ;) Feel free to ask if you have further questions.
PS: For a good overview of Amarok's database layout, see here: http://gitweb.kde.org/amarok.git/blob/HEAD:/docs/database/amarok_db_schema.png |
| ![.](/img/trans.gif) | | Re: error in Ubuntu 10.10 Nov 10 2010 on content Intelligent Playlist | Hi
Just released version 0.1.5. This should fix your problem ;) Thanks again for reporting the problem ^^ |
| ![.](/img/trans.gif) | | Re: Re: Re: Re: Re: error in Ubuntu 10.10 Oct 16 2010 on content Intelligent Playlist | Okay, thank you for the information.
Today I installed Ubuntu in a virtual machine for testing and indeed the script is not working there, too. However, I somehow think this is rather a problem with the script bindings than Amarok-related, as e.g. some KDE widgets are no longer working with the old code.
I will review this ASAP, but I cannot say for sure when I'll release a new version (I'm currently a bit short of free time, so fixing the plugin could take a while, sorry for that). |
| ![.](/img/trans.gif) | | Re: Re: Re: error in Ubuntu 10.10 Oct 15 2010 on content Intelligent Playlist | Well, it indeed could be a problem with the configuration files...
Meanwhile I compiled and installed Amarok from Git; however, I do not get the problem - the plugin's working fine here.
For testing you could do the following:
Quit Amarok and open up a terminal window, there, execute the following commands:
First, make a copy of the amarokrc file:
cp .kde/share/config/amarokrc ~
amarokrc is Amaroks main configuration file, where also all plugins' settings are stored. The above command will make a backup copy of it in your Home.
Now edit this file, e.g. with kwrite:
kwrite .kde/share/config/amarokrc
Search for a line reading [Intelligent Playlist]. Delete it and the following lines until the next section.
Then restart Amarok and try whether the plugin works again.
If it does, the problem is indeed related to the configuration. If not, you could copy back the backed up version of the amarokrc file to restore the plugin's settings. In either case, please report back the results of that test. Thank you! |
| ![.](/img/trans.gif) | | Re: error in Ubuntu 10.10 Oct 13 2010 on content Intelligent Playlist | Hey,
thank you for reporting this!
I'm sorry, but I cannot say for sure what the problem might be.
I'm currently using Amarok 2.3.1; I'll update to a newer version, so I hope to find the problem rather soon ;)
In the meantime: How exactly did you upgrade? Did you completely reinstalled your system or did you do an update out of the running system (and thus kept your existing configuration files)? |
| ![.](/img/trans.gif) | | Re: error message Sep 5 2010 on content Intelligent Playlist | Thank you for reporting this.
I fixed the problem an uploaded the new version. So, hopefully it works now ;) |
| ![.](/img/trans.gif) | | Re: Re: Re: already a fan, and an error Mar 3 2010 on content Intelligent Playlist | No problem. Already extended my packaging scripts, so starting with the next release I'll include all necessary information in the archive file name ;) |
| ![.](/img/trans.gif) | | Re: already a fan, and an error Mar 3 2010 on content Intelligent Playlist | Hi
Thank you for pointing this out ;) I made some restructuring recently but somehow omitted testing the second mode ^^'
Already fixed the bug and uploaded a new version, so I hope it now should fully work. |
| ![.](/img/trans.gif) | | Re: crash Dec 14 2009 on content KEmu | OK, I've just packaged and uploaded the current version from repository.
This should fix this problem (at last I hope so, because my tests suggest that indeed this issue is due to different behavior of Ruby 1.8 <-> 1.9) |
| ![.](/img/trans.gif) |
Search people Current visitors New users Birthdays Most active users Back
|
|