-
 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    LinuxDaily.com    Linux42.org    OpenSkillz.com   
 
Apps
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login


Sponsoring


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

Score2Rating

   3.0  

Amarok Script

Score 76%
Score2Rating
zoom


Link:  http://
Downloads:  577
Submitted:  Dec 18 2005
Updated:  Jul 27 2006

Description:

Score2Rating is a script that converts the scores of your tracks in Amarok to ratings using some
pretty accurate intervals. (In the future, the intervals might become changeable).
This is mostly usable to give you a starting point for using the new rating system in Amarok 1.4.
Tracks that already have a rating will only be updated if the calculated rating is higher.
If you have kdialog installed, a nice progressbar will be displayed showing how the script progresses.
It is recommended that you back up your database (the statistics table at least) before
running this script. It should do no harm, but you can never be too safe...

Requirements:
Amarok 1.4-beta3 or newer
Ruby 1.8 (not sure about the version, 1.6 _might_ work, I didn't test it.)

====================================
WARNING! READ THIS BEFORE UPGRADING FROM v2.0!
v2.0 had a packaging bug that will remove all other scripts when you uninstall it.
This can be fixed by (instead of uninstalling) manually removing the files "README" and "score2rating.rb" from your ~/.kde/share/apps/amarok/scripts folder and then restarting Amarok.
YOU HAVE BEEN WARNED!
====================================




Changelog:

2006-07-27 (v3.0)
I'm an idiot. I made the script WAY to advanced from the beginning.
I can't believe I didn't come to think about this earlier.
Anyhow. instead of running 4 dcop calls per track (and some more), this version runs a grand total of 9 dcop calls (one per rating) to Amarok and 10 to update and close the optional progress bar KDialog. It doesn't even care about the problemous file names. On my computer with my ~1000 track music collection, this is more than 500 times faster, seriously. It's all about SQL Magic!

(This new version is tested successfully with both MySQL and SQLite, but not PostgreSQL. If you've run it successfully with PgSQL, pop me a note, preferably via email.)


2006-07-26 (v2.5)
This should REALLY fix the problems some people are having by escaping all (?) special characters that confuse the dcop query commands (', " and `). The most common problem seems to have been files with "double quotes" in their file names. (I was able to reproduce the error).
This version also adds better error handling so the script can finish cleanly even if it encounters an error.

2006-07-16 (v2.2)
Sorry about this version mess, but I found a bug with the conversion (tracks with score 100 wouldn't get any rating).

2006-07-16 (v2.1)
This release should fix the errors some people get by also escaping backticks. (It works for me now, and I could reproduce it before the fix.)
It also fixes a packaging bug from 2.0, which would make uninstalling the script remove all other installed scripts.

2006-07-12 (v2.0)
Finally the script works again, much because of a patch I got from Elliot Pahl (halcyonCorsair).
The script now also updates ratings of tracks that already have a rating (but only if the new rating is higher).
Additionaly, a KDialog progressbar was added.

2005-12-20 (v1.2)
Removed the unneeded .svn dir from the package file...




LicenseGPL
(Score2Rating v3.0)
Send to a friend
Subscribe
Other  Apps  from Firetech
Report inappropriate content



-

 Conversion

 
 by MikeM on: Dec 18 2005
 
Score 50%

Hello,

As I have version 1.3.6 (which doesn't contain the field 'rating' in the 'statistics' table from the database) I didn't make use of your script but I looked at the source and I have a little question. When you do case foo when 0...5 (...) when 5...10 (...) isn't the 5 ambigious ?

Tahnk you :)

PS: I noticed that your tarball contains the .svn directory (5Ko~)


Only two things are infinite: The universe and human stupidity, but I'm not sure about the first.
Reply to this

-

 Re: Conversion

 
 by Firetech on: Dec 20 2005
 
Score 50%

I had to wrap the intervals, else some ratings would stay nil (I don't really get why). As I'm comparing a float with integers, it's kind of logical. (Although, I got the same behaviour when I converted the score to an integer too...)

Thanks for noticing the .svn dir, I'll remove it as soon as I get home... (I'm in school now, and I don't really want to publish a WinRAR-created bz2 file here... ;) ) I panicked for a while when I thought that the password was saved there, but it wasn't... phew.


Jocke "Firetech" Andersson
Reply to this

-

 Re: Conversion

 
 by Qerub on: Apr 22 2006
 
Score 50%

Actually, no. 5...10 is the range [5,10[. 5..10 is [5,10] though.


Reply to this

-

 script not working?

 
 by dangle on: Mar 24 2006
 
Score 50%

I'm getting ruby errors with 1.4-svn (build date March 21) - has something changed with the script manager?

/home/dangle/.kde3.5/share/apps/amarok/scripts/score2rating/score2rating.rb:34:in `Float': invalid value for Float(): "" (ArgumentError)
from /home/dangle/.kde3.5/share/apps/amarok/scripts/score2rating/score2rating.rb:34
from /home/dangle/.kde3.5/share/apps/amarok/scripts/score2rating/score2rating.rb:32
from /home/dangle/.kde3.5/share/apps/amarok/scripts/score2rating/score2rating.rb:21

Regards, Christie


Reply to this

-

 Re: script not worki

 
 by dangle on: Mar 26 2006
 
Score 50%

apparently the script isn't tested on recent versions and isn't being supported... I'll see if I can find out what's going on and post a fix later, if anyone's interested.


Reply to this

-

 Re: script not worki

 
 by stifi on: May 27 2006
 
Score 50%

I don't know if you have found a solution. Anyway changing line 33 into sqlurl = url.gsub( /'/, '\'\'' ) solved the problem for me.


Reply to this

-
.

 Error

 
 by TOD on: Jul 14 2006
 
Score 50%

Hi

I get the folow error on 25%:

/home/manuel/.kde/share/apps/amarok/scripts/score2rating.rb:46:in `Float': invalid value for Float(): "" (ArgumentError)
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating.rb:46
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating.rb:40:in `each'
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating.rb:40
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating.rb:24:in `loop'
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating.rb:24

THX for Help

TOD


Reply to this

-
.

 Re: Error

 
 by cannajunk on: Jul 15 2006
 
Score 50%

got error code around 18% / 19%

sh: -c: line 0: unexpected EOF while looking for matching ``'
sh: -c: line 1: syntax error: unexpected end of file
/home/vincent/.kde/share/apps/amarok/scripts/score2rating.rb:46:in `Float': invalid value for Float(): "" (ArgumentError)
from /home/vincent/.kde/share/apps/amarok/scripts/score2rating.rb:46
from /home/vincent/.kde/share/apps/amarok/scripts/score2rating.rb:40:in `each'
from /home/vincent/.kde/share/apps/amarok/scripts/score2rating.rb:40
from /home/vincent/.kde/share/apps/amarok/scripts/score2rating.rb:24:in `loop'
from /home/vincent/.kde/share/apps/amarok/scripts/score2rating.rb:24

Any help is welcome ;-)


Reply to this

-

 Re: Re: Error

 
 by Firetech on: Jul 16 2006
 
Score 50%

Must be a problem with the filenames in your collection. Probably one of them contains a ` (backtick), which makes the script confused.
I'll look into it.


Jocke "Firetech" Andersson
Reply to this

-
.

 Re: Re: Error

 
 by Firetech on: Jul 16 2006
 
Score 50%

This should be fixed in v2.2 (and v2.1, 2.2 just fixes a conversion bug), I tried it and got it to work successfully.


Jocke "Firetech" Andersson
Reply to this

-
.

 Re: Re: Re: Error

 
 by bitcrazy on: Jul 16 2006
 
Score 50%

Hi,
sorry but the error is still here:
/home/ds/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:46:in `Float': invalid value for Float(): "" (ArgumentError)
from /home/ds/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:46
from /home/ds/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:40
from /home/ds/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:24

Greetings

m0nk


If men could get pregnant, abortion would be a sacrament.
Reply to this

-

 Re: Re: Re: Error

 
 by amarok on: Jul 17 2006
 
Score 50%

Jocke, it's a good idea to use exception handling to catch such runtime errors.

--Mark


Reply to this

-
.

 2.2 Does't Work

 
 by TOD on: Jul 22 2006
 
Score 50%

Hi I have downloaded 2.2 and this error is shown on 25%:

/home/manuel/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:46:in `Float': invalid value for Float(): "" (ArgumentError)
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:46
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:40:in `each'
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:40
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:24:in `loop'
from /home/manuel/.kde/share/apps/amarok/scripts/score2rating/score2rating.rb:24

THX for Help

TOD


Reply to this

-

 Re: 2.2 Does't Work

 
 by Firetech on: Jul 26 2006
 
Score 50%

This SHOULD be fixed in v2.5, at least you will be given an error report to send to me (if it doesn't work).


Jocke "Firetech" Andersson
Reply to this

-
.

 Yeah it works

 
 by htownallstar555 on: Dec 17 2006
 
Score 50%

Your scrip works but I have one problem. Do you know of a script that will automatically score the song or can you tell me how to create one


Reply to this

-
.

 Ratings

 
 by 5er on: May 24 2008
 
Score 50%

Where can I get those stars ratings? I have amarok 1.4.8, but the ratings are not there.


Reply to this

Add commentBack






-
-
Do you like or dislike Ubuntu Unity?
 Yes, unity is alien technology!
 It is less confusing than Gnome 3 default, shell.
 Granny thinks it is much more usable than Gnome 2
 Canonical is embarrasing itself with this split project
 Gnome 3 default shell is much better
 I dislike Unity, Gnome 3 default shell is alien technology!
 None of the above, I like the 2Gb for free and Apple alike behavior. Will post a comment instead

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

Participate
Groups
Forum
Add App
Public API
About KDE-Apps.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2003-2014 KDE-Apps.org Team  
All rights reserved. KDE-Apps.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
KDE and K Desktop Environment are trademarks of KDE e.V.