beets icon indicating copy to clipboard operation
beets copied to clipboard

deezer: Sometimes uses locale-specific name for "Various Artists"

Open JOJ0 opened this issue 2 years ago • 7 comments

As you can see below, when tagging with Deezer plugin, it seem like since I'm located in a german speaking country, the API responds with german names for Various Artists releases. I assume we don't have a setting to ensure accessing the API "in english" ;-) Also note: My OS language is actually set to english! So it must be something with the location / the IP I'm coming from....

/path/to/music/John Handy; Hotep Cecil Barnard; Mike Hoffmann; Chuck Rainey; Eddie Bongo Brown; James Gadson - Jazz #1_s - Hard Work.mp3 (1 items)
Sending event: import_task_before_choice
Sending event: before_choose_candidate

  Match (63.3%):
  Verschiedene Interpreten - Jazz #1's
  ≠ artist, year, tracks
  Deezer, None, 2007, None, Universal Music Group International, None, None
  https://www.deezer.com/album/102392
  ≠ Artist: Various Artists -> Verschiedene Interpreten
  * Album: Jazz #1's
     * (#11) Hard Work (6:54)

Without further ado: If anyone wants to dig around in that plugin and point me somewhere, I will fix it. I see two possible ways:

  • Make it configurable via config.yaml, defaulting to english, no matter what the local language is.
  • Hardcoding it to english (my preferred option since we don't have that anywhere else in beets -> streamlining behaviour is key!)

JOJ0 avatar Oct 19 '23 10:10 JOJ0

There is a language option in the config.

arsaboo avatar Oct 19 '23 12:10 arsaboo

Thanks for that hint @arsaboo ! :-)

I tried to set it to

import:
    languages: ['en']

but unfortunately I don't experience a change in the results Deezer gives me. I still receive "Verschiedene Interpreten" instead of "Various Artists" in all my candidates.

Most probably this option does only affect MusicBrainz code - but I did in no means investiage any of this..... just noting it here and will report once I find the time to do that (or someone else is bored and wants to investiage? ;-))) haha

JOJ0 avatar Oct 20 '23 11:10 JOJ0

Interestingly, I don't even have languages in my config, but I have never seen this before. Is it possible that your location settings are not right?

arsaboo avatar Oct 20 '23 14:10 arsaboo

Interesting! To make the implicit explicit, the likely thing going on here is that Deezer is using IP geolocation to guess which language you want and returning results accordingly. Beets is asking for the artist and getting this language-specific string from Deezer in the artist field.

I think the thing to do would be to see if the API provides any kind of metadata to identify VA releases in a language-independent way. That's what we do with MusicBrainz: https://github.com/beetbox/beets/blob/efc2cf70134721eadb9110adef335127dd926a7a/beets/autotag/mb.py#L37

Then beets could ignore the actual artist string and fill in a hard-coded "Various Artists" string instead?

sampsyo avatar Oct 20 '23 19:10 sampsyo

I patched my deezer.py file with this.

-        album_data = requests.get(self.album_url + deezer_id).json()
+        headers = {"Accept-Language": "en-US,en;q=0.5"}
+        album_data = requests.get(self.album_url + deezer_id, headers=headers).json()

I didn't test with non-Latin (Cyrillic/CJK) artists in my library, to see if they change the names

GuilhermeHideki avatar Dec 01 '23 00:12 GuilhermeHideki

Awesome @GuilhermeHideki, you want open a PR submitting that change? Would be as my second bullet point suggests in the initial description.

JOJ0 avatar Dec 01 '23 23:12 JOJ0

I patched my deezer.py file with this.

-        album_data = requests.get(self.album_url + deezer_id).json()
+        headers = {"Accept-Language": "en-US,en;q=0.5"}
+        album_data = requests.get(self.album_url + deezer_id, headers=headers).json()

I didn't test with non-Latin (Cyrillic/CJK) artists in my library, to see if they change the names

doesn't seem to work anymore

amogus07 avatar Aug 16 '24 21:08 amogus07