Handle seasons with a "null" air date #175

Open
Kevinjil wants to merge 2 commits from fix/empty-air-date into master
Kevinjil commented 2025-04-19 10:18:59 +00:00 (Migrated from github.com)

Fixes #151

Fixes #151
Kevinjil commented 2025-04-19 10:19:34 +00:00 (Migrated from github.com)

@martenumberto Since you seem to have the data available, would you mind testing this change?

@martenumberto Since you seem to have the data available, would you mind testing this change?
martenumberto commented 2025-04-20 12:51:49 +00:00 (Migrated from github.com)

Sadly it doesnt work.
It seams that the Newtonsoft JSON Reader hase some problems with it.
Have a look at my PR: 2ad85050c4
I've closed it due to errors when i start playback of an Episode corresponding to the error

The Log with your PR:

[2025-04-20 14:50:44.751 +02:00] [ERR] [27] Jellyfin.Xtream.SeriesChannel: Failed to get channel items
Newtonsoft.Json.JsonReaderException: Could not convert string to DateTime: null. Path 'seasons[0].air_date', line 1, position 165.
at Newtonsoft.Json.JsonReader.ReadDateTimeString(String s)
at Newtonsoft.Json.JsonTextReader.FinishReadQuotedStringValue(ReadType readType)
at Newtonsoft.Json.JsonTextReader.ReadAsDateTime()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
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 existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
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, Object existingValue)
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 existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
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(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)
at Jellyfin.Xtream.Client.XtreamClient.QueryApi[T](ConnectionInfo connectionInfo, String urlPath, CancellationToken cancellationToken)
at Jellyfin.Xtream.Service.StreamService.GetSeasons(Int32 seriesId, CancellationToken cancellationToken)
at Jellyfin.Xtream.SeriesChannel.GetSeasons(Int32 seriesId, CancellationToken cancellationToken)
at Jellyfin.Xtream.SeriesChannel.GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken)

Sadly it doesnt work. It seams that the Newtonsoft JSON Reader hase some problems with it. Have a look at my PR: https://github.com/Kevinjil/Jellyfin.Xtream/pull/174/commits/2ad85050c493f8325067d5b0fc0e67f84d5fb9ca I've closed it due to errors when i start playback of an Episode corresponding to the error The Log with your PR: > [2025-04-20 14:50:44.751 +02:00] [ERR] [27] Jellyfin.Xtream.SeriesChannel: Failed to get channel items Newtonsoft.Json.JsonReaderException: Could not convert string to DateTime: null. Path 'seasons[0].air_date', line 1, position 165. at Newtonsoft.Json.JsonReader.ReadDateTimeString(String s) at Newtonsoft.Json.JsonTextReader.FinishReadQuotedStringValue(ReadType readType) at Newtonsoft.Json.JsonTextReader.ReadAsDateTime() at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter) 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 existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) 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, Object existingValue) 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 existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) 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(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value) at Jellyfin.Xtream.Client.XtreamClient.QueryApi[T](ConnectionInfo connectionInfo, String urlPath, CancellationToken cancellationToken) at Jellyfin.Xtream.Service.StreamService.GetSeasons(Int32 seriesId, CancellationToken cancellationToken) at Jellyfin.Xtream.SeriesChannel.GetSeasons(Int32 seriesId, CancellationToken cancellationToken) at Jellyfin.Xtream.SeriesChannel.GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken)
Kevinjil commented 2025-05-05 11:41:59 +00:00 (Migrated from github.com)

@martenumberto Re-reading your messages, is the value in the JSON literally a string "null", instead of a null JSON value? If so, could you test this change?

@martenumberto Re-reading your messages, is the value in the JSON literally a string "null", instead of a `null` JSON value? If so, could you test this change?
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/empty-air-date:fix/empty-air-date
git checkout fix/empty-air-date
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sirherobrine23/Jellyfin_Xtream#175
No description provided.