fdemmer / Picard-Last.fm.ng-Plugin

A last.fm-tag plugin for MusicBrainz Picard
GNU General Public License v3.0
87 stars 17 forks source link

Improvements with feat. artists #63

Open Rouzax opened 4 years ago

Rouzax commented 4 years ago

I've been using your plugin for a very long time and thank you for all the work

There are a few cases where it will not fetch any Genres because of the way that MusicBrainz structures the artist and title. For instance the track: Martin Garrix ft. Bonn - Home When fetching the Genres from Last.fm it will fetch this URL https://ws.audioscrobbler.com/2.0/?method=track.gettoptags&track=Home&artist=Martin%20Garrix%20ft.%20Bonn&api_key=0a8b8f968b285654f9b4f16e8e33f2ee That results in:

<lfm status="ok">
  <toptags artist="Martin Garrix ft. Bonn" track="Home"/>
</lfm>

I've played with the settings: ignore_feat_artists = False but that does not help a lot since it will then do a call to : https://ws.audioscrobbler.com/2.0/?method=track.gettoptags&track=Home&artist=Martin%20Garrix&api_key=0a8b8f968b285654f9b4f16e8e33f2ee That results in:


<lfm status="ok">
  <toptags artist="Martin Garrix" track="Home"></toptags>
</lfm>

I do have a plugin enabled to standardize Feat. which will Standardises "featuring" join phrases for artists to "feat." but this plugin does not take that in to account. The other problem is that MusicBrainz by default will put Feat. artists in the artists field whereas Last.FM expects them in the title. I also have enabled the plugin Feat. Artists in Titles but also this is done after the calls to Last.fm

If for example we do a call for track Martin Garrix - Home (Feat. Bonn) While fetching URL: https://ws.audioscrobbler.com/2.0/?method=track.gettoptags&track=Home%20(feat.%20Bonn)&artist=Martin%20Garrix&api_key=0a8b8f968b285654f9b4f16e8e33f2ee The result is:

<lfm status="ok">
  <toptags artist="Martin Garrix" track="Home (feat. Bonn)">
    <tag>
      <count>100</count>
      <name>2010s</name>
      <url>https://www.last.fm/tag/2010s</url>
    </tag>
    <tag>
      <count>100</count>
      <name>2019</name>
      <url>https://www.last.fm/tag/2019</url>
    </tag>
    <tag>
      <count>50</count>
      <name>electronic</name>
      <url>https://www.last.fm/tag/electronic</url>
    </tag>
    <tag>
      <count>50</count>
      <name>electropop</name>
      <url>https://www.last.fm/tag/electropop</url>
    </tag>
    <tag>
      <count>50</count>
      <name>pop</name>
      <url>https://www.last.fm/tag/pop</url>
    </tag>
    <tag>
      <count>50</count>
      <name>bonn</name>
      <url>https://www.last.fm/tag/bonn</url>
    </tag>
    <tag>
      <count>50</count>
      <name>Martin Garrix</name>
      <url>https://www.last.fm/tag/Martin+Garrix</url>
    </tag>
  </toptags>
</lfm>

Lastly would it be possible to adhere to the capitalization of the config.ini file for the tags? Right now I need to choose between all lowercase or the Capitalize function in the script but that will butcher R&B into R&b 😄 In my config I've listed everything as I want it to be capitalized.

Environment and versions

mxjeff commented 4 years ago

Why not using mbid parameter instead of artist, it should solve that kind of issue and others (for instance artist homonyms).

n.b. i'm not involved in this plugin development but I'm using last fm API for my own projects.

fdemmer commented 4 years ago

Those sound like reasonable requests/ideas.

Unfortunately I do not have time to work on this, but I'll gladly accept pull-requests.

If anyone wants to take a stab at it, please do it in small increments for easier reviewing and describe how behavior changes so we can include a useful summary in upcoming release notes.

It probably makes sense to separate any capitalization changes from the "featured artists" issue.

imolb commented 3 years ago

Similar problem with multiple artists per album, where last.fm has only one, but MusicBrainz two.

Example: In last.fm the release has only one artist: https://www.last.fm/de/music/Herbert+Gr%C3%B6nemeyer/Stand+Der+Dinge But in MusicBrainz there are two: https://musicbrainz.org/release/2c3d5cf2-ae16-47bf-987a-e78c8394c4c1 Picard concatenates both artists from MusicBrainz in the artist metatag with &. The query of the last.fm.ng plugin to last.fm fails and returns no results with both artists in the artist parameter: https://ws.audioscrobbler.com/2.0/?method=track.gettoptags&track=Ouvert%C3%BCre&artist=Herbert%20Gr%C3%B6nemeyer%20%26%20Sinfonieorchester%20NDR%20Hannover%20Pops%20Orchestra&api_key=0a8b8f968b285654f9b4f16e8e33f2ee

Maybe the suggestion from mxjeff helps here for some tracks, but not all tracks/albums at last.fm do have the mbid. Therefore a step wise approach sounds reasonable:

  1. Lookup with mbid
  2. Lookup with metatdata['artist']
  3. Lookup with each(first?) element from metadata['artists']