jellyfin / jellyfin-plugin-discogs

Jellyfin Discogs Plugin
GNU General Public License v3.0
7 stars 0 forks source link

Error trying to update metadata #5

Open abrittaf opened 9 months ago

abrittaf commented 9 months ago

Hi there!, The plugin was installed and an configured for metadata and images fetching. I'm using a discogs personal token.

These log messages appear when I try to refresh metadata for a particular Album.

[09:05:48] [ERR] [40] MediaBrowser.Providers.Music.AlbumMetadataService: Error in Discogs
System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at Jellyfin.Plugin.Discogs.DiscogsApi.Request(HttpRequestMessage request, CancellationToken cancellationToken) in /app/Jellyfin.Plugin.Discogs/DiscogsApi.cs:line 81
   at Jellyfin.Plugin.Discogs.DiscogsApi.GetRelease(String id, CancellationToken cancellationToken) in /app/Jellyfin.Plugin.Discogs/DiscogsApi.cs:line 97
   at Jellyfin.Plugin.Discogs.Providers.DiscogsAlbumProvider.GetMetadata(AlbumInfo info, CancellationToken cancellationToken) in /app/Jellyfin.Plugin.Discogs/Providers/DiscogsAlbumProvider.cs:line 80
   at MediaBrowser.Providers.Manager.MetadataService`2.ExecuteRemoteProviders(MetadataResult`1 temp, String logName, TIdType id, IEnumerable`1 providers, CancellationToken cancellationToken)

Regards, Fernando

PS: At discogs one have "Releases" and "Master Releases", on the other side Jellyfin identify dialog offers "Discogs Album Id" and "Discogs Release Group Id". Could you please clarify ID equivalences? Thanks in advance

nielsvanvelzen commented 9 months ago

I think what happens is that the item it tries to fetch metadata for has the discogs album and/or release id set to an invalid value. We should deal with this in the plugin instead of throwing errors though.

PS: At discogs one have "Releases" and "Master Releases", on the other side Jellyfin identify dialog offers "Discogs Album Id" and "Discogs Release Group Id". Could you please clarify ID equivalences? Thanks in advance

Unfortunately the web client generates these names and we can't change them from the plugin, I believe is it based on MusicBrainz terminology. The supported types in the plugin currently are:

Jellyfin Discogs
Artist Artist
Album Master
Release Group Release
abrittaf commented 9 months ago

There is a feature in Jellyfin that helps you identify an album at the metadata source before you fetch it. I've tried with several albums using discogs master release id as jellyfin discogs album id as you suggested but it also ended with an exception.

[19:20:42] [ERR] [50] MediaBrowser.Providers.Manager.ProviderManager: Provider Discogs failed to retrieve search results
System.NullReferenceException: Object reference not set to an instance of an object.
   at Jellyfin.Plugin.Discogs.Providers.DiscogsAlbumProvider.GetSearchResults(AlbumInfo searchInfo, CancellationToken cancellationToken) in /app/Jellyfin.Plugin.Discogs/Providers/DiscogsAlbumProvider.cs:line 48
   at MediaBrowser.Providers.Manager.ProviderManager.GetSearchResults[TLookupType](IRemoteSearchProvider`1 provider, TLookupType searchInfo, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ProviderManager.GetRemoteSearchResults[TItemType,TLookupType](RemoteSearchQuery`1 searchInfo, BaseItem referenceItem, CancellationToken cancellationToken)

At discogs website, IDs are offered to be copied from the browser using the format [r999999] for releases and [m999999] for master releases. I've tried to identify the album using either [m999999], m999999 and 999999 formats without any success.

Regards

KodeToad commented 1 month ago

Same issue here. Looks like the url used by the plugin isn't formed as the api expects. https://www.discogs.com/developers

When using just the release id by itself, this is the error

Oct 02 18:31:54 jellyfin jellyfin[53769]: System.InvalidOperationException: The node must be of type 'JsonArray'.
Oct 02 18:31:54 jellyfin jellyfin[53769]:    at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_NodeWrongType(String typeName)
Oct 02 18:31:54 jellyfin jellyfin[53769]:    at System.Text.Json.Nodes.JsonNode.AsArray()
Oct 02 18:31:54 jellyfin jellyfin[53769]:    at Jellyfin.Plugin.Discogs.Providers.DiscogsAlbumProvider.GetSearchResults(AlbumInfo searchInfo, CancellationToken cancellationToken)
Oct 02 18:31:54 jellyfin jellyfin[53769]:    at MediaBrowser.Providers.Manager.ProviderManager.GetRemoteSearchResults[TItemType,TLookupType](RemoteSearchQuery`1 searchInfo, BaseItem referenceItem, CancellationToken cancellationToken)