jesseward / jellyfin-plugin-lastfm

LastFM plugin for the Jellyfin media system. Fork of the Emby Last.FM plug-in
178 stars 11 forks source link

Every primary artist image search is returning the same placeholder image. #25

Closed OdinGitDat closed 3 years ago

OdinGitDat commented 4 years ago

The search result for every returned lastfm artist primary image query is the same. (https://lastfm.freetls.fastly.net/i/u/300x300/2a96cbd8b46e442fc41c2b86b821562f.png)

palceholder

[DBG] [6] MediaBrowser.Providers.Music.ArtistMetadataService: Running "ArtistNfoProvider" for "/config/metadata/artists/A. G. Cook"
[DBG] [6] MediaBrowser.Providers.Music.ArtistMetadataService: Running "LastfmArtistProvider" for "/config/metadata/artists/A. G. Cook"
[DBG] [69] MediaBrowser.Providers.Music.ArtistMetadataService: Running "ArtistImageProvider" for "/config/metadata/artists/A. G. Cook"
[DBG] [69] MediaBrowser.Providers.Music.ArtistMetadataService: Running "ArtistProvider" for "/config/metadata/artists/A. G. Cook"
[DBG] [69] MediaBrowser.Providers.Music.ArtistMetadataService: Running "LastfmImageProvider" for "/config/metadata/artists/A. G. Cook"
[DBG] [69] Emby.Server.Implementations.Data.SqliteItemRepository: "GetItemList" query time (slow): 23.4366ms. Query: "select type,data,EndDate,ChannelId,CommunityRating,CustomRating,IndexNumber,IsLocked,PreferredMetadataLanguage,PreferredMetadataCountryCode,Width,Height,DateLastRefreshed,Name,Path,PremiereDate,Overview,ParentIndexNumber,ProductionYear,OfficialRating,ForcedSortName,RunTimeTicks,Size,DateCreated,DateModified,guid,Genres,ParentId,Audio,IsInMixedFolder,DateLastSaved,LockedFields,Studios,Tags,OriginalTitle,PrimaryVersionId,DateLastMediaAdded,Album,CriticRating,IsVirtualItem,SeriesName,PresentationUniqueKey,InheritedParentalRatingValue,ExternalSeriesId,Tagline,ProviderIds,Images,ProductionLocations,ExtraIds,TotalBitrate,ExtraType,Artists,AlbumArtists,ExternalId,SeriesPresentationUniqueKey,OwnerId from TypedBaseItems A where IsFolder=@IsFolder AND type in ('MediaBrowser.Controller.Entities.Audio.Audio','MediaBrowser.Controller.Entities.MusicVideo','MediaBrowser.Controller.Entities.Audio.MusicAlbum') AND ((guid in (select itemid from itemvalues where CleanValue = (select CleanName from TypedBaseItems where guid=@ArtistIds0) and Type<=1)))"
[DBG] [69] MediaBrowser.Providers.Manager.ProviderManager: Saving "/config/metadata/artists/A. G. Cook" to "Nfo".
[DBG] [69] Emby.Server.Implementations.Library.LibraryManager: ConvertImageToLocal item 836e7c83-0b98-4685-e591-f9b3222d8123 - image url: "https://lastfm.freetls.fastly.net/i/u/300x300/2a96cbd8b46e442fc41c2b86b821562f.png"
[DBG] [25] MediaBrowser.Providers.Manager.ProviderManager: Saving image to "/config/metadata/artists/A. G. Cook/folder.png"
[DBG] [6] MediaBrowser.Providers.Manager.ProviderManager: Saving "/config/metadata/artists/A. G. Cook" to "Nfo".
[DBG] [6] Emby.Drawing.ImageProcessor: Getting image size for item "MusicArtist" "/config/metadata/artists/A. G. Cook/folder.png"

Log is the same for any artist name, artist descriptions are pulled fine.

jesseward commented 4 years ago

As LastFM slowly removes public API features, client applications need to back out these changes. In May of 2019, LastFM disabled Artist image downloads from their API.

Some details here https://stackoverflow.com/questions/55978243/last-fm-api-returns-same-white-star-image-for-all-artists

We’ve made changes to our API in order to limit abuse and improve the service for everyone, in line with our API Terms of Use.

While we allow API users to have access to a lot of data through the API, it has always been against our API Terms of Use for third parties to use audio, audiovisual, images or artwork. In some instances, some data may have been indirectly accessible through a small number of API calls, and so as part of the recent API clean-up, we have corrected that anomaly. If your application is affected, please refer to our API Terms of Use to ensure your compliance.

In the 6.0.0.0 release of I removed artist image downloading (commit:https://github.com/jesseward/jellyfin-plugin-lastfm/commit/ec6ed965164c1e874b44d72d2922bc2d2ab4df98) from the LastfmArtistProvider, but it looks like the capability is still exposed to the IRemoteImageProvider interface at https://github.com/jesseward/jellyfin-plugin-lastfm/blob/master/Jellyfin.Plugin.Lastfm/Providers/LastfmImageProvider.cs#L40

@OdinGitDat a few asks

  1. ensure you're running the latest version of this plugin v6.0.0.0, released a few days ago
  2. Chose an artist with the image fetched from LastFM API, that has the default / deprecated endpoint marking (the star) and force a refresh of metadata, ensuring to check replace images.
  3. report back.

In parallel, I will remove the remaning cruft in LastfmImageProvider.cs and spit out version 6.0.0.1

OdinGitDat commented 4 years ago

Yes, my original issue was created running v6 and the log paste was done after performing step 2. Sad to see API features removed, thanks for explaining.

jesseward commented 4 years ago

submitted commit:https://github.com/jesseward/jellyfin-plugin-lastfm/commit/0fe2ce51bbcfc7e6590db0219e16453618c8abde , which removes support for LastFM artist image fetching.

v6.0.0.1 has been pushed to plugin repo.

OdinGitDat commented 4 years ago

Hey just a FYI, the artist image fetcher is now removed as you said, but the album image fetcher is still present. I haven't tested it, but according to your source they also disabled that in the API so I think it should go too.

jesseward commented 3 years ago

I haven't tested it, but according to your source, they also disabled that in the API so I think it should go too.

FWIW, the album API response still returns a proper image location. Though given the slow death of LastFM I suspect it won't last forever.. For now, I will leave this functionality "as-is".

http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=<KEY_REMOVED>&artist=Nightmares%20On%20Wax&album=Smokers%20Delight&format=json

{
  "album": {
    "name": "Smokers Delight",
    "artist": "Nightmares on Wax",
    "mbid": "db44215c-a798-4148-8896-47d0244fb48c",
    "url": "https://www.last.fm/music/Nightmares+on+Wax/Smokers+Delight",
    "image": [
      {
        "#text": "https://lastfm.freetls.fastly.net/i/u/34s/c8f88d0a468a4c21ccea851c4a8a9be2.png",
        "size": "small"
      },
      {
        "#text": "https://lastfm.freetls.fastly.net/i/u/64s/c8f88d0a468a4c21ccea851c4a8a9be2.png",
        "size": "medium"
      },
      {
        "#text": "https://lastfm.freetls.fastly.net/i/u/174s/c8f88d0a468a4c21ccea851c4a8a9be2.png",
        "size": "large"
      },
      {
        "#text": "https://lastfm.freetls.fastly.net/i/u/300x300/c8f88d0a468a4c21ccea851c4a8a9be2.png",
        "size": "extralarge"
      },
      {
        "#text": "https://lastfm.freetls.fastly.net/i/u/300x300/c8f88d0a468a4c21ccea851c4a8a9be2.png",
        "size": "mega"
      },
      {
        "#text": "https://lastfm.freetls.fastly.net/i/u/300x300/c8f88d0a468a4c21ccea851c4a8a9be2.png",
        "size": ""
      }
    ],
    "listeners": "83336",
    "playcount": "1153462",
    "tracks": {
      "track": [
        {
          "name": "Nights Interlude",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Nights+Interlude",
          "duration": "204",
          "@attr": {
            "rank": "1"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Dreddoverboard",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Dreddoverboard",
          "duration": "348",
          "@attr": {
            "rank": "2"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Pipes Honour",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Pipes+Honour",
          "duration": "545",
          "@attr": {
            "rank": "3"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Me + You",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Me+%252B+You",
          "duration": "56",
          "@attr": {
            "rank": "4"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Stars",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Stars",
          "duration": "419",
          "@attr": {
            "rank": "5"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Wait A Minute",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Wait+A+Minute",
          "duration": "164",
          "@attr": {
            "rank": "6"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Prayin' For A Jeepbeat",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Prayin%27+For+A+Jeepbeat",
          "duration": "90",
          "@attr": {
            "rank": "7"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Groove St.",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Groove+St.",
          "duration": "449",
          "@attr": {
            "rank": "8"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Time (to Listen)",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Time+(to+Listen)",
          "duration": "25",
          "@attr": {
            "rank": "1"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "(Man) Tha Journey",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/(Man)+Tha+Journey",
          "duration": "379",
          "@attr": {
            "rank": "2"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Bless My Soul",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Bless+My+Soul",
          "duration": "357",
          "@attr": {
            "rank": "3"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Cruise (Don't Stop)",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Cruise+(Don%27t+Stop)",
          "duration": "425",
          "@attr": {
            "rank": "4"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Mission Venice",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Mission+Venice",
          "duration": "170",
          "@attr": {
            "rank": "5"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "What I'm Feelin (Good)",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/What+I%27m+Feelin+(Good)",
          "duration": "146",
          "@attr": {
            "rank": "6"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Rise",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Rise",
          "duration": "314",
          "@attr": {
            "rank": "7"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Rise (Reprise)",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Rise+(Reprise)",
          "duration": "106",
          "@attr": {
            "rank": "8"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        },
        {
          "name": "Gambia Via Vagator Beach",
          "url": "https://www.last.fm/music/Nightmares+on+Wax/_/Gambia+Via+Vagator+Beach",
          "duration": "281",
          "@attr": {
            "rank": "9"
          },
          "streamable": {
            "#text": "0",
            "fulltrack": "0"
          },
          "artist": {
            "name": "Nightmares on Wax",
            "mbid": "b8c5cc4f-239f-4e02-b46f-b040b77c2030",
            "url": "https://www.last.fm/music/Nightmares+on+Wax"
          }
        }
      ]
    },
    "tags": {
      "tag": [
        {
          "name": "downtempo",
          "url": "https://www.last.fm/tag/downtempo"
        },
        {
          "name": "chillout",
          "url": "https://www.last.fm/tag/chillout"
        },
        {
          "name": "electronic",
          "url": "https://www.last.fm/tag/electronic"
        },
        {
          "name": "trip-hop",
          "url": "https://www.last.fm/tag/trip-hop"
        },
        {
          "name": "chill",
          "url": "https://www.last.fm/tag/chill"
        }
      ]
    }
  }