Warning: session_start(): open(/tmp/sess_9shlqbbtccr8ij45lsh275upb2, O_RDWR) failed: No space left on device (28) in /www/H01/htdocs/lib/base/lib_base.php on line 280
Intelligent Playlist openDesktop.org
-
 KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
--
-
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
--
-
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
--
-
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
--
-
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
--
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    Linux42.org    OpenSkillz.com   
 
Home
Apps
Artwork
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login


-
- Content .- Fans (4) .- Knowledge Base  . 

Intelligent Playlist

   0.2.0  

Amarok 2.0 Script

Score 79%
Homepage:  Link
Downloads:  323
Submitted:  Feb 25 2010
Updated:  Dec 28 2010

Description:

A short warning beforehand: I have written this script for an Artificial Intelligence lecture at my university. Thus, its main goal is to apply some typical algorithms and ideas from AI in a real-life software project. If you are seeking for something to integrate typical Similar Artists functionality provided by online services, you are better off with Amarok's Dynamic Playlists (and some custom biases) or something like this:
http://kde-apps.org/content/show.php/AutoPlaylist?content=120476

The plugin functions by dropping just some tracks into an initial playlist. Turn the plugin on and hit the play button. The plugin will then try to find similar tracks from your local collection. So, beneath of using a similarity comparison instead of a given (a-priory) set of rules (biases) it shall not distinguish too much in how it presents itself to the user compared to Amarok's Dynamic Playlists.

For a detailed description, please have a look at the projects homepage.

Please note, that this is currently rarely tested. This means: It might work for your music flavor and collection or not. I have made pretty good experience, but I cannot guarantee that this will apply to everyone else. So, feedback and further suggestions about how to improve the plugin are very welcome ;)




Changelog:

0.2.0:
* plugin is now localizable
* added Czech translations (thanks to Pavel Fric)
* added German translations
* using UniqueIds to add tracks to playlist (to preserve compatibility across versions of Amarok)

0.1.5:
* replaced some code to fix problems with Ubuntu 10.10

0.1.4:
* fixed Bug in Track module

0.1.3:
* fixed a bug that prevented the plugin from adding selected tracks to playlist (only occurred with newer versions of Amarok)

0.1.2:
* fixed bug when using match-at-last-one-track mode

0.1.1:
* little fixes in script spec
* little improvement in playlist solver

0.1:
* initial public release




LicenseGPL
(Intelligent Playlist Plugin)
Send to a friend
Subscribe
Other  Content  from pen2
Report inappropriate content



-

 already a fan, and an error

 
 by groo on: Mar 2 2010
 
Score 50%

Very nice script and work, i hope you can keep on enhancing it.

it works very well in playlist mode, but if i change the settings to one track only i get this error:

There was an error in the Intelligent Playlist plugin!

Error: TypeError: Result of expression 'sim.setArtist' [undefined] is not a function.
Error Name: TypeError
Message: Result of expression 'sim.setArtist' [undefined] is not a function.
File: PlaylistSolver.js
Line: 395

besides that it works like a charm :)

best regards


Reply to this

-

 Re: already a fan, and an error

 
 by pen2 on: Mar 3 2010
 
Score 50%

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.


Reply to this

-

 Re: Re: already a fan, and an error

 
 by groo on: Mar 3 2010
 
Score 50%

Hi, thanks for your swift answer..

ill test this new version asap.
one other thing, could you please append the version number to the download file. i do packages for (k)ubuntu and its very hard to send them upstream when the original file doesnt have a version number.

best regards and keep up the good work


Reply to this

-

 Re: Re: Re: already a fan, and an error

 
 by pen2 on: Mar 3 2010
 
Score 50%

No problem. Already extended my packaging scripts, so starting with the next release I'll include all necessary information in the archive file name ;)


Reply to this

-

 error message

 
 by deadbabylon on: Sep 5 2010
 
Score 50%
deadbabylondeadbabylon
Fedora Project
Home

I get this error when skipping to the last track in my playlist:

There was an error in the Intelligent Playlist plugin!

Error: Error: QUrl::QUrl(): could not find a function match; candidates are:
QUrl()
QUrl(String url)
QUrl(String url, ParsingMode mode)
QUrl(QUrl copy)
Error Name: Error
Message: QUrl::QUrl(): could not find a function match; candidates are:
QUrl()
QUrl(String url)
QUrl(String url, ParsingMode mode)
QUrl(QUrl copy)
File: Track.js
Line: 247


Reply to this

-

 Re: error message

 
 by pen2 on: Sep 5 2010
 
Score 50%

Thank you for reporting this.

I fixed the problem an uploaded the new version. So, hopefully it works now ;)


Reply to this

-
.

 error in Ubuntu 10.10

 
 by schnecki on: Oct 12 2010
 
Score 50%

Hi,

I am using the latest Ubuntu Version 10.10 and Amarok Version 2.3.2 (KDE 4.5.1).

Since yesterday, the day I upgraded Ubuntu from 10.04 to 10.10, a problem with the Intelligent Playlist Plugin appears when the song switches.

Errortext:
----------
There was an error in the Intelligent Playlist plugin!

Error: TypeError: Result of expression 'this.m_plugin.configuration' [undefined] is not an object.
Error Name: TypeError
Message: Result of expression 'this.m_plugin.configuration' [undefined] is not an object.
File: PlaylistSolver.js
Line: 446
----------

I guess that a important Javascript Library was deleted during the Upgrade. But I can't figure out which one it could be.

Do you know what I need to do, to make the plugin working again?

Thanks,

schnecki

P.S.: I am really disappointed by that error, because this wonderful plugin does not work anymore :(


Reply to this

-

 Re: error in Ubuntu 10.10

 
 by pen2 on: Oct 13 2010
 
Score 50%

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)?


Reply to this

-

 Re: Re: error in Ubuntu 10.10

 
 by schnecki on: Oct 14 2010
 
Score 50%

ok, so it's probably a problem in the latest Amarok version...

I just upgraded my Ubuntu and should still have my configuration files. But I deleted some gnome files, due to Desktop problems (those are solved). Command:
rm -rf .gnome .gnome2 .gconf .gconfd .metacity


---
I hope this helps.

Best regards


Reply to this

-

 Re: Re: Re: error in Ubuntu 10.10

 
 by pen2 on: Oct 15 2010
 
Score 50%

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!


Reply to this

-

 Re: Re: Re: Re: error in Ubuntu 10.10

 
 by schnecki on: Oct 15 2010
 
Score 50%

OK, I did what you told me to do. Unfortunately it did not change anything. The same errors appear.

I did not restore my backup file...I don't think it should change anything.


schnecki


Reply to this

-

 Re: Re: Re: Re: Re: error in Ubuntu 10.10

 
 by pen2 on: Oct 16 2010
 
Score 50%

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


Reply to this

-
.

 Re: Re: Re: Re: Re: Re: error in Ubuntu 10.10

 
 by schnecki on: Oct 22 2010
 
Score 50%

ok that's good for me. I just got another few playlist I have to listen to until I need your plugin ;)

Take ur time.



-

 Re: error in Ubuntu 10.10

 
 by pen2 on: Nov 10 2010
 
Score 50%

Hi
Just released version 0.1.5. This should fix your problem ;) Thanks again for reporting the problem ^^


Reply to this

-

 how to use addMedia??

 
 by evel on: Nov 18 2010
 
Score 50%

Hey Martin!

First of all, congratulations on the work you've done!

I really hope that you can help me. I'm trying to write an Amarok script and I need to add some local files to the current playlist. The problem is that I don't know how to achieve this using "addMedia", since I can't find a way to select a track from its path. It should be a very easy task, but I didn't find any documentation on this!!
I analyzed your code without luck.
I just need something very simple, like this:

getSongs = Amarok.Collection.query("SELECT `url` FROM `tracks`")
for (var song in getSongs)
Amarok.Playlist.addMedia(new QUrl(decodeURI(getSongs[song])))


Help me pleaseee!!
Thanks you in advance.

Best
Alberto


Reply to this

-

 Re: how to use addMedia??

 
 by pen2 on: Nov 19 2010
 
Score 50%

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


Reply to this

-

 Re: Re: how to use addMedia??

 
 by evel on: Nov 19 2010
 
Score 50%


Thank you very much for the reply!!

I've tried your code, but I get an error. When putting this into the Script Console:

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 ) );
}

I get:

not a track no match
amarok: BEGIN: void Playlist::Controller::insertOptioned(Meta::TrackPtr, int)
amarok: END__: void Playlist::Controller::insertOptioned(Meta::TrackPtr, int) - Took 0.00011s

(one error for each track)

The variable path anyway is properly filled, since if I try this:

var songs = Amarok.Collection.query("SELECT rpath FROM urls LIMIT 10;" );
for ( var i in songs ){
var path = songs[ i ];
Amarok.debug( path );
}

I get the right paths printed on the debug message.

Any idea? Have I got to do something to make the "QUrl" work? Actually I import "qt.core" both in my script than in the Script Console...


Reply to this

-

 Re: Re: Re: how to use addMedia??

 
 by pen2 on: Nov 19 2010
 
Score 50%

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.


Reply to this

-

 Re: Re: Re: Re: how to use addMedia??

 
 by evel on: Nov 19 2010
 
Score 50%


Martin,
thanks A LOOOOT for your helpfulness, now it works!!
The problem was, as you suggested, in the "file://" prefix (and I also have to erase the first character from the path, because it's a point).
I'm using Amarok 2.3.0, not that old...
Thank you again, also for the useful link to the database structure.

Keep on the good work,
Alberto


Reply to this

Add commentBack




-



 
 
 Who we are
Contact
More about us
Frequently Asked Questions
Register
Twitter
Blog
Explore
Apps
Artwork
Jobs
Knowledge
Events
People
Updates on identi.ca
Updates on Twitter
Content RSS   
Events RSS   

Participate
Groups
Forum
Add Content
Public API
About openDesktop.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2007-2016 openDesktop.org Team  
All rights reserved. openDesktop.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
openDesktop is a trademark of the openDesktop.org Team