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   


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

Last Sync

   0.1 *beta*  

Amarok Script

Score 65%
Downloads:  450
Submitted:  Sep 6 2007


=> Lastsync? What the ... (the short way)
Lastsync is a ruby script to download your last.fm statistics like playcount of your music files and save it to your Amarok database. This is particular useful if you scrobble from many sources (Linux, Windows, iPod ...) but want to have a accurate Amarok statistic (e.g. for creating dynamic playlists).

=> What this script does (the long way)
Last.fm provides their complete information in a XML format for easy access (see http://www.audioscrobbler.net/data/webservices/ for more details), but there\'s no way to see the complete playcount of all tracks ever listened (the \"Top Tracks\" stream only shows the Top 50). To solve this problem, the script downloads your complete \"Weekly Chart List\" history and processes week by week, summing up the playcount of all weeks. The script then searches for each track in your Amarok database and sets the playcount, score, last played and first played time of the appropriate files. This is not completely accurate, but works (for me it counted 23.000 of my 24.000 plays), to achieve the best results run it Sunday Noon, after last.fm updates their Weekly Chart.
Please note that the script currently only runs with a SQLite Amarok-backend.

=> Features
- Retrieve your last.fm stats (playcount, score, last played, first played) and save it to your Amarok
- Correct misstagged id3 tags
- Supported backend: SQLite
- More to come :D

=> Known Bugs
This is my first ruby script, so it is pretty hacked together and there will be bugs, so always make a backup of your collection.db! You have been warned!

I want to improve my Ruby skills, so comments or improvements are very welcome.
If you found a bug, want to make a feature request or just want to say "thank you", you can leave a comment, write an email or make a shout to my last.fm shoutbox under http://www.last.fm/user/LordGartenzwerg/

For usage and more info see the README file.

Send to a friend
Other  Apps  from lordgartenzwerg
Report inappropriate content



 by ageha on: Sep 11 2007
Score 50%

any chance for a MySql version some day?

Reply to this


 Re: MySql?

 by lordgartenzwerg on: Sep 12 2007
Score 50%

Well it should be easy to do this, I will have a look into it ...

Reply to this


 Failed :(

 by Db0 on: Mar 25 2008
Score 50%

I'm trying to make this run on amarok 1.4.8 but I get the following error when I run it on the terminal


/usr/lib/ruby/site_ruby/1.8/sqlite3/errors.rb:94:in `check': near "weird": syntax error (SQLite3::SQLException)
from /usr/lib/ruby/site_ruby/1.8/sqlite3/statement.rb:71:in `initialize'
from /usr/lib/ruby/site_ruby/1.8/sqlite3/database.rb:184:in `new'
from /usr/lib/ruby/site_ruby/1.8/sqlite3/database.rb:184:in `prepare'
from /usr/lib/ruby/site_ruby/1.8/sqlite3/database.rb:211:in `execute'
from /usr/lib/ruby/site_ruby/1.8/sqlite3/database.rb:292:in `get_first_row'
from ./amarok.rb:32:in `getURL'
from ./amarok.rb:141:in `update'
from ./lastsync.rb:61
from ./lastsync.rb:60:in `each'
from ./lastsync.rb:60
from ./lastsync.rb:58:in `each'
from ./lastsync.rb:58

Any idea?

Reply to this


 Re: Failed :(

 by gliblygangrenous on: Aug 26 2008
Score 50%

The script fails any time it comes across a quotation mark in a song title... or an artist name, I guess. All you need to do is navigate to ~/.kde/share/apps/amarok/scripts/lastsync/data and find the .xml file that the script crashed on. Open it in gedit or whatever and then type ctrl+f to search and type " and delete the song entry (or entries) from the .xml file. I've found that restoring the backup collection.db file is wise prior to re-running the script, so delete the file home/user/.kde/share/apps/amarok/collection.db and rename home/user/.kde/share/apps/amarok/collection.db~ deleting the tilde and you should be good to go. Depending on how long you've been on last.fm you may have to repeat this process several times in order for the script to complete.

Reply to this


 unquoted variables && sql

 by dotcomstu on: Feb 25 2009
Score 50%

To fix this issue i pass the parameters to the query via the questionmark placeholders, in doing so i quote the variables using the database layer!

so... replace line 32 of amarok.rb with:

resultArtist = @db.get_first_row("SELECT * FROM artist WHERE LOWER(name) = ?", artist.downcase)

and also line 38 with:

result = @db.get_first_row("SELECT * FROM tags WHERE artist = ? AND LOWER(title) = ?", resultArtist[0], name.downcase)

and that should fix

Reply to this


 Seems to have failed

 by medievalkarl on: Aug 17 2008
Score 50%

I run the script but it doesn't affect my playcounts.

Here's what I get:

Backing up Amarok collection under /home/karl/.kde/share/apps/amarok/collection.db~
Loading Replace List ...
/usr/lib/ruby/1.8/rexml/source.rb:156:in `readline': end of file reached (EOFError)
from /usr/lib/ruby/1.8/rexml/source.rb:156:in `initialize'
from /usr/lib/ruby/1.8/rexml/source.rb:16:in `new'
from /usr/lib/ruby/1.8/rexml/source.rb:16:in `create_from'
from /usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:130:in `stream='
from /usr/lib/ruby/1.8/rexml/parsers/baseparser.rb:107:in `initialize'
from /usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:8:in `new'
from /usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:8:in `initialize'
from /usr/lib/ruby/1.8/rexml/document.rb:205:in `new'
from /usr/lib/ruby/1.8/rexml/document.rb:205:in `build'
from /usr/lib/ruby/1.8/rexml/document.rb:42:in `initialize'
from ./lastfm.rb:39:in `new'
from ./lastfm.rb:39:in `initialize'
from ./lastsync.rb:55:in `new'
from ./lastsync.rb:55

Reply to this


 Quotation error

 by Mirksar on: Sep 20 2008
Score 50%

Hi there!

To fix the quotation error, just add this line

name = name.gsub('"', '""')

in the function getURL, at module amarok.rb, just after

if artist == nil or name == nil
return nil

Reply to this


 Amarok 2/MySQL ?

 by bitcrazy on: Apr 8 2009
Score 50%

Any plans for Amarok 2? That would be really great, especially because I have to rebuild my collection very often.

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



 by passerby on: Sep 6 2009
Score 50%

all i get is this

chris@linux-y76din7PC:~/Desktop/lastsync> ./lastsync.rb "eagles500"
./amarok.rb:14:in `require': no such file to load -- sqlite3 (LoadError)
from ./amarok.rb:14
from ./lastsync.rb:18:in `require'
from ./lastsync.rb:18
any suggestions on how i can make it run through

im on openSuSE 11.1

Reply to this

Add commentBack

How do you like Plasma 5?
 The best KDE Desktop ever.
 Definitely a nice improvement.
 Not decided yet. Haven't tried it yet.
 I do not like some of the changes.
 KDE is taking the wrong way.
 I am still sticking with KDE 3.5.
 I have no opinion, but wanted to vote anyway.

 Who we are
More about us
Frequently Asked Questions
Updates on identi.ca
Updates on Twitter
Content RSS   
Events RSS   

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

Copyright 2003-2016 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.