Description: This Amarok-script fetches GlobalTags from last.fm on trackchange or for the selected songs in the playlist. The Tags are added as labels to the amarok-database. Band name and track name as tags are now filtered out.
Additional Features: *ban tags with a blacklist *configure maximum number tags to fetch for a track *configure minimum score each tag must have *enable/disable automatic fetching of tags upon trackchange
Default for tagcount is 5, for the blacklist it is "live" and "seen live", for min-score 35 and automatic-fetching on trackchange is disabled.
If you have files with with two paths to them in your collection, the script will fail.
If the script does not work: * Do a full rescan of your collection * Try with a clean database * Mail me
Deps: *ruby *internet connection *Amarok with label support >=1.4.5 or SVN-rev>=611097 *kdialogLast changelog:
1.0.2: * Replace substr with substring for mysql
1.0.1: * now really fix the bug if deviceid=-1 (thanks to theta7) * nil and "" are not the same
0.9.9: * fix bug if dynamic collection isn't enabled (hopefully) * Added configure-option for min-score
0.9.7: * Added a output-function, code is now little shorter * Better filtering
0.9.5: * Work with Proxies * Now determine engine over dcop * Use chomp instead of manual cutting * Added configure option to disable automatic fetching on tackchange
0.9.0: * Fixed a bug with postgresql, now treat postgresql as sqlite * Added a little configure dialog for tagcount and blacklist * Added a blacklist
0.8.5: * Catch a error from last.fm that occurs sometimes * Filter out band and track name * Fetch the #{tagcount} best tags instead of tags with a weight >#{tagcount}
0.8.0: * Now use a dcop-call to determine the proxy * Check also for tags on trackchange
0.7.4: * Assume sqlite if no backend gets detected
0.7.3: * Urls with a ' in didn't work, perhaps some escaping is needed again for other special chars?
0.7.2: * worked around "/" as mountpoint
0.7.1: * path to config-file was hardcoded, forgot to change that
0.7.0: * Checks now if mysql/postgresql or sqlite is used * Identification is now done by uid
0.6.5: * Add fetch-limit * Fix crash when no title or artist is set.
0.6.0: * Add tags over the dcop-call of Amarok.
0.5.0: * Create context-menu, now it's a real amarokscript
Would it be possible to add in an option to only use the last.fm tags from the profile of the user? i.e., if I have my last.fm username in Amarok set to defaultxr and this option enabled, the script would only load the tags that defaultxr used on the track and not global tags.
I'd also like to see the possibility previously suggested to update last.fm's tag database when we remove or add a label in Amarok. But that's not as important as my first wish.
I like this script so far otherwise; it is a great idea, and thank you for writing it :) I would add these functions myself, but I don't know Ruby. :(
I have som songs with title and artist in Cyrillic letters. E.g. ДДТ - Родина. According to http://www.lastfm.se/music/ДДТ/_/Родина this song has the following tags (sans quotes): "flute", "hell yeah", "philosophical", "piano", "rock", "russian", "russian rock" and "singalong", but synctags gives the song these tags (again sans quotes): "jrock", "J-rock", "japanese", "nothing", "News", "Shogo Hamada", "Arashi" and "Piknik". I'm using synctags version 1.0.2.
when geting the tabs for a huge playlist (like if we want to update the tags of the entire collection) the script import just tags from some musics (20 or 30 first musics), and not to all of then.
hi,
i love this script, but there are two things that annoy me.
first it sometimes adds empty labels (""). it's very hard to remove them again. could you please make a check for these empty labels before adding them?
the second thing is, that sometimes wrong tags are added to a track. if i remove them, they are readded when listening to the track again. so would it be possible to check, weather the track has already tags or maybe even better make a list of files that have been tagged by synctag and check every file against this list before adding labels (except the user called synctag via the context menu).
Hi
Can someone please tell me where i access the tags when they've been added? I've figured out how to tag entries, and rescanned my library, but how do i actually make use of the tags??
Surely i'm missing something really obvious...
What about syncing tags the other way?
I mean to have the possibility to sync (post) locally added labels to lastfm account.
IMHO this could greatly improve lastfm integration in amarok!
keep up the good work!
GOo
/home/underguiz/.kde/share/apps/amarok/scripts/synctags-ohneconf/synctags.rb:181:in `fetchandwriteTag': private method `chomp' called for nil:NilClass (NoMethodError)
from /home/underguiz/.kde/share/apps/amarok/scripts/synctags-ohneconf/synctags.rb:391
from /home/underguiz/.kde/share/apps/amarok/scripts/synctags-ohneconf/synctags.rb:380
from /home/underguiz/.kde/share/apps/amarok/scripts/synctags-ohneconf/synctags.rb:328
Hurra,
I'm really impressed with the speed of the last couple of versions. It's not blocking everything on track change like it was earlier. Great job!
bodly
I think it's better to stay with this little bug instead of rescaning my collection and losing all my scores and stuff. And i don't use KDE. :D Thnaks for your answer.
Yeah, that's the problem. kded needs to run, if you want to use dynamic collections anyways.
A full rescan shoudn't drop your stats. To stay safe, you could make a backup before scanning.
I think that's not the problem. I'm not a KDE user, but it doesn't mean that i don't have kded running. I do have ( 5423 ? S 0:00 kded [kdeinit]) since amarok runs all the needed kde stuff on startup.
and... i forgot, i'm running mysql as amarok database. So backup my database and create everything again is just a think that i don't want right now hehe.. sorry for my annoyance.
But i'm going stop complaining and try to figure out the reason of this error, and thus, help you.
Thanks :D
Well, you could try this:
dcop amarok collection query "SELECT * FROM uniqueid WHERE deviceid=-1 LIMIT 5"
If it contains your music, the next version will help you :)
Ratings & Comments
77 Comments
Is it possible to make this script working on amarok 2.x? I love this script, but i can't make it working on new great amarok...
Would it be possible to add in an option to only use the last.fm tags from the profile of the user? i.e., if I have my last.fm username in Amarok set to defaultxr and this option enabled, the script would only load the tags that defaultxr used on the track and not global tags. I'd also like to see the possibility previously suggested to update last.fm's tag database when we remove or add a label in Amarok. But that's not as important as my first wish. I like this script so far otherwise; it is a great idea, and thank you for writing it :) I would add these functions myself, but I don't know Ruby. :(
I have som songs with title and artist in Cyrillic letters. E.g. ДДТ - Родина. According to http://www.lastfm.se/music/ДДТ/_/Родина this song has the following tags (sans quotes): "flute", "hell yeah", "philosophical", "piano", "rock", "russian", "russian rock" and "singalong", but synctags gives the song these tags (again sans quotes): "jrock", "J-rock", "japanese", "nothing", "News", "Shogo Hamada", "Arashi" and "Piknik". I'm using synctags version 1.0.2.
when geting the tabs for a huge playlist (like if we want to update the tags of the entire collection) the script import just tags from some musics (20 or 30 first musics), and not to all of then.
Yes, there is a limit. We don't want to overload their servers.
ok, i agree
hi, i love this script, but there are two things that annoy me. first it sometimes adds empty labels (""). it's very hard to remove them again. could you please make a check for these empty labels before adding them? the second thing is, that sometimes wrong tags are added to a track. if i remove them, they are readded when listening to the track again. so would it be possible to check, weather the track has already tags or maybe even better make a list of files that have been tagged by synctag and check every file against this list before adding labels (except the user called synctag via the context menu).
so here is a dirty hack for the wrong label problem: http://kaligames.de/temp/synctags.filelist.txt
Hi Can someone please tell me where i access the tags when they've been added? I've figured out how to tag entries, and rescanned my library, but how do i actually make use of the tags?? Surely i'm missing something really obvious...
now you can filter your collection by labels ;) (e.g. label:rock)
What about syncing tags the other way? I mean to have the possibility to sync (post) locally added labels to lastfm account. IMHO this could greatly improve lastfm integration in amarok! keep up the good work! GOo
/home/underguiz/.kde/share/apps/amarok/scripts/synctags-ohneconf/synctags.rb:181:in `fetchandwriteTag': private method `chomp' called for nil:NilClass (NoMethodError) from /home/underguiz/.kde/share/apps/amarok/scripts/synctags-ohneconf/synctags.rb:391 from /home/underguiz/.kde/share/apps/amarok/scripts/synctags-ohneconf/synctags.rb:380 from /home/underguiz/.kde/share/apps/amarok/scripts/synctags-ohneconf/synctags.rb:328
yeah i get the same thing...
Hurra, I'm really impressed with the speed of the last couple of versions. It's not blocking everything on track change like it was earlier. Great job! bodly
I got the same "Could not determine URL" problem, but only with a few tracks. Hope this could be fixed soon :). Love the script btw, thanks.
Make sure kded is running and try a full rescan after that. I think i found the problem. Just waiting for a users answer :)
I think it's better to stay with this little bug instead of rescaning my collection and losing all my scores and stuff. And i don't use KDE. :D Thnaks for your answer.
Yeah, that's the problem. kded needs to run, if you want to use dynamic collections anyways. A full rescan shoudn't drop your stats. To stay safe, you could make a backup before scanning.
I think that's not the problem. I'm not a KDE user, but it doesn't mean that i don't have kded running. I do have ( 5423 ? S 0:00 kded [kdeinit]) since amarok runs all the needed kde stuff on startup.
and... i forgot, i'm running mysql as amarok database. So backup my database and create everything again is just a think that i don't want right now hehe.. sorry for my annoyance. But i'm going stop complaining and try to figure out the reason of this error, and thus, help you. Thanks :D
Well, you could try this: dcop amarok collection query "SELECT * FROM uniqueid WHERE deviceid=-1 LIMIT 5" If it contains your music, the next version will help you :)
For me, the problem was the substr function in the SQL queries. This function is named substring in mysql. After I changed this, the script worked.
Ahh, ok. Thanks I'll change this.
Hi, I just switched from sqlite to mysql and now I get the same error. I'm running the latest version with the substr/substring replacement.
I have installed 0.7.9 on Amarok 1.4.5, now I get Could not determine URL. very strange