rdswift / picard-plugins

Picard plugins: use 1.0 branch for Picard < 2.0 (python 2/Qt4) and 2.0 branch for Picard >= 2.0 (python 3/Qt5)
18 stars 2 forks source link

Artist country not always returned #8

Open rdswift opened 6 months ago

rdswift commented 6 months ago

See the initial discussion on the Community Forum, where @mfmeulenbelt was encountering problems with the artist country information not always being returned from the Additional Artists Details plugin.

kthugs commented 6 months ago

I'm using this script $set(_tmp,artist$getmulti(%musicbrainzartistid%,0)) $set(country,$if2($get(%_tmp%country),$get(%_tmp%begin_country),$get(%_tmp%end_country),xx))

I turned on both "process track artists" and "include area details" options.

There were instances where the "xx" issue occurred when loading multiple releases, but the issue was resolved when refreshing the album corresponding to "xx" in Picard.

However, we found a problem where only "xx" is returned when the artist's country is "Ireland". Only tracks by Irish artists on albums by multiple artists will always return "xx" Albums by Irish artists also return only “xx” for all tracks.

I'm glad I found the plugin I really needed and it's really useful. thank you

rdswift commented 6 months ago

@kthugs, can you please provide an example of a release that isn't working (MBID or link to the release) so I can test it here? Also I did find a bug that caused that for cases where the country was being returned from the MusicBrainz API as an ISO-3166-2 code rather than an ISO-3166-1 code. I wasn't aware the API would do that. I've updated the plugin to accept either version, so if you're not using version 0.4, I suggest that you update your version of the plugin and see if that helps. I'm still trying to solve the issue with having to reload a release to get the country code to work reliably.

kthugs commented 6 months ago

@rdswift https://musicbrainz.org/release/2087ea14-633c-44f9-83ae-8a26bc98d243 Only tracks 3 and 10

https://musicbrainz.org/release/d06b848b-d949-418e-a613-8f6bd9457017

rdswift commented 6 months ago

@kthugs, thanks for the examples. These helped point to an odd case of possibly mis-linked areas in the MB database. I've updated the plugin to accommodate this situation, and it now properly shows Ireland as the country for the examples you provided. You can download the updated plugin from my repo and install it manually using the instructions for Installing Third-Party Plugins. If you try this, please let me know if the plugin works for you. Note that I'm still trying to find a fix for sometimes having to reload a release to get the country code properly assigned, so I'm not closing off this issue.

kthugs commented 6 months ago

@rdswift, Works great!! Thanks!!

rdswift commented 6 months ago

@mfmeulenbelt, @kthugs

I think that I have corrected the problem with some artist countries not being returned unless you reload the release. Can you please download the updated plugin from my repo and install it manually using the instructions for Installing Third-Party Plugins. Please test it out and let me know if this resolves the issue or if you're still having problems. Once we're sure that it seems to be corrected, I'll package it up and submit the update to the "official" Picard plugins for general release. Thanks.

Also note that the option settings for the plugin have changed slightly to provide more granularity regarding which types to omit from the location shown in the tags.

kthugs commented 6 months ago

@rdswift Unfortunately, it hasn't been completely fixed yet. A few things I tested with this updated version...

  1. Albums composed of multi-discs
  2. Single disc album or multiple albums with few tracks, such as EPs

When loading several albums with a small number of tracks, such as EPs or singles, only 1 album out of 12 displayed "xx". After refreshing (Ctrl+R) everything showed the correct values. I deleted all of Picard's list and reloaded the same albums. All 12 showed correct values. (Album artist and track artist are both the same) Now I quit Picard, ran it again, and loaded the same albums again. 10 out of 12 display "xx"

Albums that were multi-disc and had a lot of tracks were terribly slow to load, so it felt like the "xx" value occurred more often, but it didn't make much of a difference.

!!I just discovered something For example, when loading several albums at the same time, including singles, EPs, etc. of "rdswift", some albums randomly display the value "xx".

but!! First load only one album or one track from "rdswift" into Picard. If the "country" value was displayed correctly, "xx" would not be displayed even if several other "rdswift" albums were loaded at the same time until Picard was closed.!!

rdswift commented 6 months ago

@kthugs, thanks for checking. I'll give it another look, but I haven't been able to get it to fail here with the latest changes. Hopefully I can reproduce the problem using the types of releases you've mentioned.

!!I just discovered something For example, when loading several albums at the same time, including singles, EPs, etc. of "rdswift", some albums randomly display the value "xx".

but!! First load only one album or one track from "rdswift" into Picard. If the "country" value was displayed correctly, "xx" would not be displayed even if several other "rdswift" albums were loaded at the same time until Picard was closed.!!

I'm assuming you mean the rapper R-Swift since I couldn't find an artist by the name of "rdswift". In any case, that behavior by the plugin is expected (except the part of not properly indicating the country on the first load :wink: ) because it retains all area and artist information that it looks up in a cache which only gets cleared when Picard is shut down. This saves time loading other releases (or refreshing already loaded releases) by not re-requesting information (especialy areas) that it has already looked up. The issue is that it is finalizing the artist information before all of the related area lookups are complete, and (obviously) I haven't yet found a way to reliably get around that.

kthugs commented 6 months ago

@rdswift 38 tracks - 36 tracks - 60 tracks - 12 tracks It was added to the list in order of path and folder name. https://imgur.com/a/shMlCW4 Only the first item in the list shows the correct value.

Now, let’s change the order of Picard’s loading list. 12 tracks - 38 tracks - 36 tracks - 60 tracks I dragged the 12th track album first and immediately added the remaining 3 albums. https://imgur.com/a/xwRnUR6 The list loading completion order is the same, but the correct country value is shown.

This time, I changed the folder name so that the 12th track album is listed first. https://imgur.com/a/hczrhRc The result was the same as the first one

These are five albums, each from a different artist. https://imgur.com/a/mpXS2KG Oh my god, everything shows the correct country value. I relaunched Picard and tried several times and it still works properly.

Tried it again with The Verve albums. Same result as the first one

Additionally, we tried again with multiple albums from a single artist. https://imgur.com/a/B95Iizb

I'm confused :scream:

kthugs commented 6 months ago

It would be nice if everything worked as intended, but it's not difficult to press Ctrl + R to refresh once. Also, there were more cases than expected where the artist's country or area was blank, so just displaying the "xx" value was very helpful. Thank you very much! :+1:

mfmeulenbelt commented 6 months ago

I’m not sure if the new version succeeds in pulling in the artist country much more often, but as @kthugs commented, it’s not that much work to hit Ctrl-R. Thanks!