This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Amarok 2 Script: populate a playlist from local collection

Tags: None
(comma "," separated)
evel
Registered Member
Posts
1
Karma
0
Hi there,
I'm new to Amarok plugin development, and I'm trying to figure out how to add tracks to the current playlist from my local collection.
I've tryied this simple script:

Code: Select all
getSongs = Amarok.debug(Amarok.Collection.query ("SELECT url FROM tracks "));
Amarok.debug("We found this songs: "+getSongs);
for (var song in getSongs)         
    Amarok.Playlist.addMedia(new QUrl(decodeURI(getSongs[song])))


but getSongs seems to be undefined.

How can I solve this? Are there other ways to add local songs to the playlist?

Thanks,
Alberto
User avatar
eean
KDE Developer
Posts
1016
Karma
0
OS
In your code snippet, getSongs is the return value of Amarok.debug. :)


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], Sogou [Bot]