Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

soulsearchingsun, funny you should mention this - I've just been working on the same problem. FooBar writes to tags, and expects, a null character (0x00) as a field separator for multi-value fields. I've made some changes to the last.fm.plus plugin recently, and one of them is to change the default separator to be the null value. This way if you empty the field separator box, the plugin will write tags in a way that FooBar understands. The fix is just 2 lines of code in the last.fm.plus plugin:

In __init__.py, after the following line:

            join_tags = cfg["lastfm_join_tags_sign"]

Add the following 2 lines:

            if not join_tags:
                join_tags = '\x00'

The leading spaces are important, as this is how Python keeps track of code blocks. Make sure that they don't change to tabs when you cut and paste.

Once you've made this change to the code, delete the value you have in the separator field in the last.fm.plus settings page, restart Picard and you should be good to go.

On a tangential note, once I get a hold of the gui file I need for the settings page I can finally add the options to use the other changes I've made to the plugin, allowing album tags to be used for genres, etc (I don't want to use track tags as this splits albums up when browsing by genre, but I still want to have some fine-grained genre tagging that's more accurate than just artist tags).

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Awesome, thanks.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

With the lastfmplus folder under 'C:\Program Files (x86)\MusicBrainz Picard\plugins' on Win7 64bit, I get:

I: <sip.voidptr object at 0x02766FE0> 13:20:56 Plugin 'ui_options_lastfm' from 'C:\Users\MyUsername\AppData\Roaming\MusicBrainz\Picard\plugins\ui_options_lastfm.pyo' is not compatible with this version of Picard.

I uninstalled, removed registry entries, and installed version 0.15, but got the same error.  I still have 0.15 installed right now.  Is there a fix for that, or is there any additional info I can provide?  I do see the Last.fm.Plus node in the Options->Plugins tree.

Thanks

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Ohh man, this looks like just what I was looking for! I haven't tested it yet, but I was planning to ask around for a genre + country/city tagging script/ application. If this does the job, I am forever indebted to you!
I don't trust last.fm tags so much, as say, rateyourmusic (though more comprehensive), and I'm curious how you get country and city data (I've only really seen it on rym, vaguely comprehensively). But anyway, looking forward to using this!

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

airjrdn wrote:

I: <sip.voidptr object at 0x02766FE0> 13:20:56 Plugin 'ui_options_lastfm' from 'C:\Users\MyUsername\AppData\Roaming\MusicBrainz\Picard\plugins\ui_options_lastfm.pyo' is not compatible with this version of Picard.

This error implies you have 'ui_options_lastfm.py' (and .pyo) inside the plugins folder inside your "user-specific plugins" area; but not inside any 'lastfm' or 'lastfmplus' subfolder. This file (and other lastfm plugin files) shouldn't be there.

To ensure no issues with other plugins as well, open up C:\Users\MyUsername\AppData\Roaming\MusicBrainz\Picard\plugins\ and make sure that you don't have any plugins or files here that duplicate those in C:\Program Files (x86)\MusicBrainz Picard\plugins.

airjrdn wrote:

I uninstalled, removed registry entries, and installed version 0.15, but got the same error.  I still have 0.15 installed right now.

Please upgrade to the latest version; Picard 0.16. It fixes some bugs with some particular plugins and behaviour that might cause you issues in future.

aerozol wrote:

Ohh man, this looks like just what I was looking for! I haven't tested it yet, but I was planning to ask around for a genre + country/city tagging script/ application. If this does the job, I am forever indebted to you!
I don't trust last.fm tags so much, as say, rateyourmusic (though more comprehensive), and I'm curious how you get country and city data (I've only really seen it on rym, vaguely comprehensively). But anyway, looking forward to using this!

It takes a while to set up and tune to ones individual tastes, but it's generally pretty effective. Start small with some reference albums and then scale it up until you trust it with a bigger set of your collection :) In any case, credit for this really goes to luks, RifRaf, Partner and the people who originally wrote and tuned it. I just took over maintenance when they disappeared; but haven't had time to actively develop it and fix some of its issues. Hoping to get back to it and clean up some weird behaviour this year though.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Got it.  The ones in the program files folder were correct, but there were also copies in C:\Users\MyUsername\AppData\Roaming\MusicBrainz\Picard\plugins

Thanks for the help!

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

I activated the plugin but it is not adding the tags. Any ideas?

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Can you give a few more details? Which MB release/track are you trying to tag? What settings do you have for the plugin? What are you expecting to see? When you right click > details... on the track, can you see any entry for Genre or Group in the list of tags displayed. Which application are you trying to use to verify whether the tags are added?

34 (edited by codylarson 2012-01-04 20:44:12)

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

voiceinsideyou wrote:

Can you give a few more details? Which MB release/track are you trying to tag? What settings do you have for the plugin? What are you expecting to see? When you right click > details... on the track, can you see any entry for Genre or Group in the list of tags displayed. Which application are you trying to use to verify whether the tags are added?

I think I'm being a huge rookie. I had "Use Track Based Tags" unchecked AND I have the "Don't use Artist Tags" radio button selected. With these type of settings it will not even attempt to find tags correct?

UPDATE: Yup I'm an idiot. Changed those settings and now all good. What a top notch plugin. Thank you to all the contributors!

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Not so much of a rookie. To be fair, a better designed plugin would warn you of this; and/or try and change the settings for you. :)

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Hi, just wanted to thank you for this wonderful plugin. It makes fixing my collection so easy i can't believe it :D

37 (edited by FreebirdRising 2012-01-20 05:52:16)

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Hello!

I was just wondering if there is any way to make it so that 'grouping' is automatically chosen per album or artist, instead of per song?

What I'm trying to do is set up a file naming convention to include %grouping% at the very beginning, so groupings will be sorted into folders.

An example is the Aphex Twin album "Donkey Rhubarb" that has a Phillip Glass version of a song on the album. So one song gets filtered as 'classical', but this means the album is spread around in a couple different places.

Thanks in advance! :)

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

You can disable the setting to "use track-based tags" entirely. Then it will only use those from the artist; so you're more likely to end up with the same grouping across an entire release; if it is single artist.

In theory I believe there was some weighting that tended towards consistency of grouping across the entire album (even with use track-based tags enabled), however the code is quite complicated, and I have a feeling I /may/ have inadvertently broken it while trying to make the plugin compatible with Picard 0.15+.

39 (edited by Prometey 2012-02-16 00:00:51)

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Hi! Many thanks for this awesome plugin, but there are some bugs and improvements that I’ve found.

1) Minimum Tag-Weight of Track Based Tags applied for Artist Based Tags. I’ve found problem: in line 142

below = (s and weight < cfg["lastfm_min_artisttag_weight"]) or (not s and weight < cfg["lastfm_min_tracktag_weight"])

s should be replaced whith arttag

below = (arttag and weight < cfg["lastfm_min_artisttag_weight"]) or (not arttag and weight < cfg["lastfm_min_tracktag_weight"])

2) Default Tag Translation list isn’t loaded after installing plugin, only two lines with "drum and bass" appeared. It loads only after clicking "Load Default". It can be helpful for newbie users.

3) By the way, it would be cool to improve existing default tags and tags translation lists. For example, translating Death Metal to Doom Metal is wrong. I understand this is hard and maybe not critical, but it can help to new users.

4) Hints in options menu should be edited, there are many unnecessary paragraphs in them. And there are some options that can be hardly understood even with hints. For example i still don't know what "Maximum Inter-Tag Drop" means.

5) I think, that logic, when grouping and genre can't have the same tags is wrong. For example User have default options:
Major Tags - Group = 1
Minor Tags – Genre = 4
Prepend minor tags with major = enabled
Grouping = dance, electronica, folk, hip-hop, …

If song has tags: dance, electronica, hip-hop, rap. We will get:
Grouping = dance
Genre = dance, rap
So we just lost electronica and hip-hop tags.

My solution for this: copy all Grouping tags to Genre tags, disable Prepend option, delete line 170:

  # Break becase every Tag should be faced only by one GENRE_FILTER
  break

6) If someone needs the same tags for album with one main artist and a few “feat artist” tracks, replace

 get_artist_tags_func = partial(get_artist_tags, album, metadata, artist, None)

on line 363 with

                if albumartist != "Various Artists":
                    get_artist_tags_func = partial(get_artist_tags, album, metadata, albumartist, None)
                else:
                    get_artist_tags_func = partial(get_artist_tags, album, metadata, artist, None)

P.S. Sorry for my poor english.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Hi,
this plugin is pretty cool, but I found one flaw that bothered me. Some artists are spelled differently in MusicBrainz and in Last.fm. A good example could be "blink-182" group, that is spelled "Blink 182" in Last.fm. Fortunatelly, MusicBrainz keeps a list of aliases, so we can query Last.fm for all aliases and not only the main artist name. I did some coding and here is a patch:

--- original/__init__.py        2011-07-31 10:56:26.000000000 +0200
+++ modified/__init__.py        2012-03-20 14:28:35.000000000 +0100
@@ -306,6 +306,19 @@
         album._finalize_loading(None)
 
 
+def get_artist_aliases(release):
+       aliases = []
+       try:
+               artist = release.children['recording'][0].children['artist_credit'][0].children['name_credit'][0].children['artist'][0]
+               #aliases.append(artist.children['name'][0].text)
+               for alias in artist.children['alias_list'][0].children['alias']:
+                       aliases.append(alias.text)
+               print aliases
+       except KeyError:
+               pass
+       return aliases
+
+
 def get_tags(album, metadata, path, sally, factor, min, drop, next, current):
     """Get tags from an URL."""
     url = str(QtCore.QUrl.fromPercentEncoding(path))
@@ -359,7 +372,13 @@
         title = metadata["title"]
         if artist:
             if use_artist_tags:
-                get_artist_tags_func = partial(get_artist_tags, album, metadata, artist, None)
+               prev_get_artist_tags_func = None
+               for artist_alias in get_artist_aliases(release):
+                       get_artist_tags_func = partial(get_artist_tags, album, metadata, artist_alias, prev_get_artist_tags_func)
+                       print get_artist_tags_func
+                       prev_get_artist_tags_func = get_artist_tags_func
+               get_artist_tags_func = partial(get_artist_tags, album, metadata, artist, prev_get_artist_tags_func)
+               print get_artist_tags_func
             else:
                 get_artist_tags_func = None
             if title and use_track_tags:

I wrote it with almost no knowledge of how things work inside of Picard, so maybe someone should take a look at the code before merging with the "master branch". However, it should be working, at least it is working for me.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

That looks like it would slow the plugin down many times for some artists which have dozens of aliases.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

I agree, maybe this option should be checkable through GUI or maybe we could add some logic that these alias artist names would get fetched only if original artist name didn't return any tags.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Is it somehow possible to swap major and minor tags?

I tried the groupings and genre inputs in the settings but I didn't really get the desired results.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

You can just swap the tag filter lists between the two, and also swap the limits for # of major vs minor tags.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Hi!,

I don't know if this is a bug or it just happens to me, but the 'mood' tags are not saved in .mp3 files, they are only saved in .m4a files. I had used several taggers like mp3tag, musicbrainz, foobar, etc, and nothing, they don't show up :(..

What could it be?

Thanks.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

According to the tag mapping table "mood" will only be saved in mp3 (or other files using ID3 tags) if you're using ID3v2 2.4 - you can set that in the options on the "Tags" page.

47 (edited by sigi 2012-08-22 01:01:33)

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

This plugin is positively awesome, so let me first thank you!

Now, I have a minor issue, related to "decade tags", such as "70s", "80s" and so forth.
I really like those and want to use them as minor genres, so I've added them to the appropriate list.

Unfortunately, when they get saved, the letter "s" in the tag is capitalized ("80s" becomes "80S"). I don't like that.

Can this behaviour be corrected in the plugin, or is it Picard which does capitalize the first letter of a tag no matter what?  (I suppose not.)

(BTW, adding a tag translation such as "80S, 80s" does not help.)

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

sigi wrote:

Now, I have a minor issue, related to "decade tags", such as "70s", "80s" and so forth.
I really like those and want to use them as minor genres, so I've added them to the appropriate list.

Unfortunately, when they get saved, the letter "s" in the tag is capitalized ("80s" becomes "80S"). I don't like that.

What are you using to view the value of the genre/minor tag? A player application? An mp3 tag editor? As far as I know and have seen, the plugin and Picard don't randomly capitalize any tag data so my guess is that whatever you're viewing the data with is doing this capitalization when displaying genres.

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

This is a great plugin and I'd really like to integrate it into my tagging so I don't have to do genres manually, but I'm having a couple of the problems that were described above by Prometey.  The main one is the one he listed as #6.  Whenever an album has feat. artists in the track artist, it sometimes fails to get tags for those specific tracks which kind of throws off the tagging for the album as the whole, since I'd like it to be as uniform as possible.

I tried his solution but it doesn't seem to work.  I'm thinking maybe it's not copying over right or something, because when I replace the line, the lastfmplus options disappear completely and it's not listed under plugins either.  Then when I change it back to the original line, it comes back.  Does anyone know what I can do to fix this?

Re: Last.fm Plus Genre and extended tags plugin for Picard 0.15+

Could it be possible to stuff main genre into the standard genre TAG, as the basic last.fm plugin? This would ensure wider usability on multiple players, including additional tags such as mood, year, etc