Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error converting value "YANDEX_DISK" to type 'KinopoiskUnofficialInfo.ApiClient.VideoResponse_itemsSite'. #31

Open
medbedb-ru opened this issue Aug 25, 2024 · 1 comment

Comments

@medbedb-ru
Copy link

Полный стек ошибки:
KinopoiskUnofficialInfo.ApiClient.ApiException: Could not deserialize the response body stream as KinopoiskUnofficialInfo.ApiClient.VideoResponse.

Status: 200
Response:.

---> Newtonsoft.Json.JsonSerializationException: Error converting value "YANDEX_DISK" to type 'KinopoiskUnofficialInfo.ApiClient.VideoResponse_itemsSite'. Path 'items[0].site', line 1, position 125.
---> System.ArgumentException: Requested value 'YANDEX_DISK' was not found.
at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object e
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, O
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, O
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object e
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, O
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
at KinopoiskUnofficialInfo.ApiClient.Client.ReadObjectResponseAsync[T](HttpResponseMessage response, IReadOnlyDictionary2 headers, CancellationToken cancellationToken) --- End of inner exception stack trace --- at KinopoiskUnofficialInfo.ApiClient.Client.ReadObjectResponseAsync[T](HttpResponseMessage response, IReadOnlyDictionary2 headers, CancellationToken cancellationToken)
at KinopoiskUnofficialInfo.ApiClient.Client.VideosAsync(Int32 id, CancellationToken cancellationToken)
at KinopoiskUnofficialInfo.ApiClient.KinopoiskApiClient.<>c__DisplayClass10_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at KinopoiskUnofficialInfo.ApiClient.KinopoiskApiClient.Invoke[T](Func2 method, Nullable1 ct, String memberName)
at KinopoiskUnofficialInfo.ApiClient.CachedKinopoiskApiClient.<>c__DisplayClass11_01.<<TryGetValue>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func2 factory)
at Jellyfin.Plugin.Kinopoisk.MetadataProviders.BaseVideoMetadataProvider2.GetMetadata(TLookupInfoType info, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.MetadataService2.ExecuteRemoteProviders(MetadataResult1 temp, String logName, Boolean replaceData, TIdType id, IEnumerable1 providers, CancellationToken cancellationToken)

Как повторить:
Попробовать распознать по ИД 4968810. Такая ошибка часто возникает на других ИД

Решение:
в файле GeneratedClient.generated.cs внести правки чтото вроде:
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.3.0 (Newtonsoft.Json v12.0.0.0)")]
public enum VideoResponse_itemsSite
{
[System.Runtime.Serialization.EnumMember(Value = @"YOUTUBE")]
YOUTUBE = 0,

    [System.Runtime.Serialization.EnumMember(Value = @"KINOPOISK_WIDGET")]
    KINOPOISK_WIDGET = 1,

    [System.Runtime.Serialization.EnumMember(Value = @"UNKNOWN")]
    UNKNOWN = 2,
    [System.Runtime.Serialization.EnumMember(Value = @"YANDEX_DISK")]
    YANDEX_DISK = 3,
}

Просьба:
Можно какую нибудь инструкцию как правильно собрать под Linux_x64. При сборке VS2022 для linux-64 выводится сообщение, что плагин не поддерживается, т.к. в нем нет параметров настройки.

@mirlex1986
Copy link

mirlex1986 commented Aug 27, 2024

с форком от уважаемого @VD42 все работает

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants