synctags

Amarok 1.x Scripts

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

1
Score 50.0%
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
*kdialog
Last changelog:

12 years ago

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

0.2.0:
* Initial release

Morgenstern

9 years ago

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

Report

defaultxr

11 years ago

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. :(

Report

per

11 years ago

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.

Report

diovani

11 years ago

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.

Report

C

hurra

11 years ago

Yes, there is a limit. We don't want to overload their servers.

Report

diovani

11 years ago

ok, i agree

Report

HessiJames

12 years ago

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

Report

HessiJames

12 years ago

so here is a dirty hack for the wrong label problem:

http://kaligames.de/temp/synctags.filelist.txt

Report

liquidacid

12 years ago

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

Report

HessiJames

12 years ago

now you can filter your collection by labels ;) (e.g. label:rock)

Report

bateau

12 years ago

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

Report

underguiz

12 years ago

/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

Report

EvilGnome

12 years ago

yeah i get the same thing...

Report

bodly

12 years ago

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

Report

underguiz

12 years ago

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.

Report

C

hurra

12 years ago

Make sure kded is running and try a full rescan after that.

I think i found the problem. Just waiting for a users answer :)

Report

bugmenot

12 years ago

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.

Report

C

hurra

12 years ago

Ahh, ok. Thanks
I'll change this.

Report

beaupiccart

11 years ago

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.

Report

underguiz

12 years ago

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.

Report

C

hurra

12 years ago

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.

Report

underguiz

12 years ago

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.

Report

C

hurra

12 years ago

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

Report

underguiz

12 years ago

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

Report

chb

12 years ago

I have installed 0.7.9 on Amarok 1.4.5, now I get

Could not determine URL.

very strange

Report

12 years ago

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

0.2.0:
* Initial release

12345678910
product-maker Base: 4 x 5.0 Ratings
DaiVied
Dec 30 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
0 Affiliates
Details
license
version
1.0.2
updated Feb 20 2007
added Dec 04 2006
downloads 24h
0
pageviews 24h 4
System Tags addon