
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
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!
====================================
14 years ago
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...
14 years ago
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...
5er
12 years ago
Report
htownallstar555
14 years ago
Report
TOD
14 years ago
/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
Report
Firetech
14 years ago
Report
TOD
14 years ago
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
Report
cannajunk
14 years ago
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 ;-)
Report
Firetech
14 years ago
Report
amarok
14 years ago
--Mark
Report
bitcrazy
14 years ago
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
Report
Firetech
14 years ago
I'll look into it.
Report
dangle
15 years ago
/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
Report
dangle
15 years ago
Report
stifi
14 years ago
Report
MikeM
15 years ago
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~)
Report
Qerub
14 years ago
Report
Firetech
15 years ago
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.
Report