jellyfin / jellyfin-plugin-fanart

https://jellyfin.org
MIT License
26 stars 14 forks source link

FanArt plugin don't show any covers for music files #55

Open MaverickPOL opened 3 weeks ago

MaverickPOL commented 3 weeks ago

Hi i upgrade not long ago my Jellyfin server to 10.9.11 version and i saw now that FanArt plugin do not show any covers/artist when i try to change my images. I'm not sure that this is releated to 10.9.11 version of Jellyfin, when i last time use fanArt plugin i use it on 10.8.x and everything work OK. Now only TheAudioDB database show covers/artist images for me.

Any clue what could cause this problem?

My FanArt plugin version is 12.0.0.0 i even try to add API key, nothings change.

This is errors from log when i try to upgate/change or just check diffrent covers using FanArt plugin:


[2024-11-03 13:19:24.409 +01:00] [ERR] "ArtistProvider" failed in GetImageInfos for type "MusicArtist" at "/media/Audio/FLAC/Post Malone"
System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,Jellyfin.Plugin.Fanart.Dtos.Album]. Path: $.albums | LineNumber: 114 | BytePositionInLine: 15.
   at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.Serialization.JsonDictionaryConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TDictionary& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.DeserializeAsync(Stream utf8Json, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.AddImages(List`1 list, String path, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
[2024-11-03 13:19:27.615 +01:00] [ERR] "ArtistProvider" failed in GetImageInfos for type "MusicArtist" at "/media/Audio/FLAC/Post Malone"
System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,Jellyfin.Plugin.Fanart.Dtos.Album]. Path: $.albums | LineNumber: 114 | BytePositionInLine: 15.
   at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.Serialization.JsonDictionaryConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TDictionary& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.DeserializeAsync(Stream utf8Json, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.AddImages(List`1 list, String path, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
[2024-11-03 13:19:41.653 +01:00] [ERR] "ArtistProvider" failed in GetImageInfos for type "MusicArtist" at "/media/Audio/FLAC/Post Malone"
System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,Jellyfin.Plugin.Fanart.Dtos.Album]. Path: $.albums | LineNumber: 114 | BytePositionInLine: 15.
   at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.Serialization.JsonDictionaryConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TDictionary& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.DeserializeAsync(Stream utf8Json, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.AddImages(List`1 list, String path, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
[2024-11-03 13:19:47.302 +01:00] [ERR] "ArtistProvider" failed in GetImageInfos for type "MusicArtist" at "/media/Audio/FLAC/Post Malone"
System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,Jellyfin.Plugin.Fanart.Dtos.Album]. Path: $.albums | LineNumber: 114 | BytePositionInLine: 15.
   at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.Serialization.JsonDictionaryConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TDictionary& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.DeserializeAsync(Stream utf8Json, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.AddImages(List`1 list, String path, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
[2024-11-03 13:19:49.739 +01:00] [ERR] "ArtistProvider" failed in GetImageInfos for type "MusicArtist" at "/media/Audio/FLAC/Post Malone"
System.Text.Json.JsonException: The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,Jellyfin.Plugin.Fanart.Dtos.Album]. Path: $.albums | LineNumber: 114 | BytePositionInLine: 15.
   at System.Text.Json.ThrowHelper.ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
   at System.Text.Json.Serialization.JsonDictionaryConverter`3.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TDictionary& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
   at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.DeserializeAsync(Stream utf8Json, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.AddImages(List`1 list, String path, CancellationToken cancellationToken)
   at Jellyfin.Plugin.Fanart.Providers.ArtistProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
markalex2209 commented 3 weeks ago

As I understand problem comes from this line

var obj = await JsonSerializer.DeserializeAsync<ArtistResponse>(fileStream, JsonDefaults.Options).ConfigureAwait(false);

because structure of the JSON payload has changed.

Specifically this property

        [JsonPropertyName("albums")]
        public Dictionary<string, Album> Albums { get; set; }

is no longer Dictionary. In my local cache for one of the Artists it looks like this:

...,
    "albums": [
        {
            "release_group_id": "019d7063-0717-4ee0-beb6-bd3f31e36ce7",
            "albumcover": [
                {
                    "id": "153349",
                    "url": "https://assets.fanart.tv/fanart/music/cf075492-d880-4afc-b87b-d6b03e33dacc/albumcover/bury-me-in-vegas-54ecc34d59b8b.jpg",
                    "likes": "2",
                    "width": "1000",
                    "height": "1000",
                    "added": "2015-02-24 18:34:26"
                },
                {
                    "id": "395204",
                    "url": "https://assets.fanart.tv/fanart/music/cf075492-d880-4afc-b87b-d6b03e33dacc/albumcover/bury-me-in-vegas-63730d17d8a38.jpg",
                    "likes": "0",
                    "width": "1000",
                    "height": "1000",
                    "added": "2022-11-15 06:28:11"
                },
                {
                    "id": "390527",
                    "url": "https://assets.fanart.tv/fanart/music/cf075492-d880-4afc-b87b-d6b03e33dacc/albumcover/bury-me-in-vegas-6339749727eea.jpg",
                    "likes": "0",
                    "width": "1000",
                    "height": "1000",
                    "added": "2022-10-02 17:57:07"
                }
            ]
        },
        {
            "release_group_id": "1448b08f-e6e0-450d-bd4b-1c1ad2862704",
            "albumcover": [
                {
                    "id": "153350",
                    "url": "https://assets.fanart.tv/fanart/music/cf075492-d880-4afc-b87b-d6b03e33dacc/albumcover/eskimo-callboy-2010-54ecc34d5a70d.jpg",
                    "likes": "2",
                    "width": "1000",
                    "height": "1000",
                    "added": "2015-02-24 18:34:32"
                }
            ],
            "cdart": [
                {
                    "id": "213143",
                    "url": "https://assets.fanart.tv/fanart/music/cf075492-d880-4afc-b87b-d6b03e33dacc/cdart/eskimo-callboy-2010-58a6f3fd9b0a2.png",
                    "likes": "1",
                    "width": "1000",
                    "height": "1000",
                    "disc": "1",
                    "size": "1000",
                    "added": "2017-02-18 08:38:55"
                }
            ]
        },
MaverickPOL commented 3 weeks ago

So, plugin need some kind of changes or can i do someting myself to fix it?

markalex2209 commented 3 weeks ago

Issue is stemming from change of api version to 3.2 at 7ed50f5 There were some breaking changes in response structure there. Can be verified by comparing results for v3 and v3.2 It doesn't seem like 3.2 was released yet, or at least I can't find changelog or updated documentation.

I drafted this PR, no idea if it's enough or if it covers all the changes. @enter-a-random-username, can you check if this is enough? I can't run it locally - got Emby.Server.Implementations.Plugins.PluginManager: Failed to load assembly /config/plugins/Fanart_12.0.0.0/Jellyfin.Plugin.Fanart.dll. This error occurs when a plugin references an incompatible version of one of the shared libraries. Disabling plugin

markalex2209 commented 3 weeks ago

@MaverickPOL, yes, error is on the plugin side. If you really-really want to, you can revert version to 11.0.0. For this:

  1. In Tasks - remove scheduled auto update for plugins
  2. Go to plugins uninstall 12, install 11
  3. Restart server
  4. Remove cache for artists you already tried. In cache folder (see General > Cache path, by default /cache IIUC), you should have folder /fanart-music with content like cf075492-d880-4afc-b87b-d6b03e33dacc/fanart.json - remove that content. Or wait for two days and cache will timeout by itself.
enter-a-random-username commented 3 weeks ago

I can test it. Sorry for the inconvenience. I fixed the issue with wrong image sizes and needed the information.

EDIT: Works for me

enter-a-random-username commented 3 weeks ago

Also, I noticed some issue with image size as well.

Artist image e.g. an entry/artist with word test https://fanart.tv/artist/afb8f901-d846-4c70-a898-59bc183d1da7/crash-test-dummies/?section=thumb Shows 1000x1000, but all artist images are 500x281labeled in image selector. I think 1000x1000 is correct. Cant find any 500x500 or even 500x281 artist images. Tried some older band names