Empty series due to Serialization Exception when series air_date is invalid #151

Open
opened 2025-01-24 10:09:42 +00:00 by ochan12 · 6 comments
ochan12 commented 2025-01-24 10:09:42 +00:00 (Migrated from github.com)

One of the TV shows I wanted to see was empty in Jellyfin but I could see the content was there on other platform.
An eighth season has been announced but no release date yet, I guess that's why is empty.

This is the log

Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.DateTime'. Path 'seasons[8].air_date', line 1, position 6519.
---> System.InvalidCastException: Null object cannot be converted to a value type.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
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.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.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
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)

One of the TV shows I wanted to see was empty in Jellyfin but I could see the content was there on other platform. An eighth season has been announced but no release date yet, I guess that's why is empty. This is the log > Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.DateTime'. Path 'seasons[8].air_date', line 1, position 6519. ---> System.InvalidCastException: Null object cannot be converted to a value type. at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) --- End of inner exception stack trace --- at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) 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.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.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) 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-01-28 16:14:54 +00:00 (Migrated from github.com)

I'm wondering why unaired seasons / episodes are included in the API response. It is not possible to stream them anyway?

I'm wondering why unaired seasons / episodes are included in the API response. It is not possible to stream them anyway?
martenumberto commented 2025-04-17 22:09:55 +00:00 (Migrated from github.com)

I can confirm this issue. I'm getting the exact same error on my instance with some Series which are aired for years. I've commented the airdate out and now the Seasons are popping up. I don't know about the following issues.

Update: Episodes (corresponding to the issue) aren't playable. Others whom not affected are playing fine.

I can confirm this issue. I'm getting the exact same error on my instance with some Series which are aired for years. I've commented the airdate out and now the Seasons are popping up. I don't know about the following issues. Update: Episodes (corresponding to the issue) aren't playable. Others whom not affected are playing fine.
Kevinjil commented 2025-04-19 09:55:00 +00:00 (Migrated from github.com)

@martenumberto Do you have streamable seasons / episodes which are missing this information?

Edit: missed the update

@martenumberto Do you have streamable seasons / episodes which are missing this information? Edit: missed the update
amsatique commented 2025-05-14 20:46:17 +00:00 (Migrated from github.com)

Hey, having the same issue here.

[20:43:10] [ERR] [64] Jellyfin.Xtream.SeriesChannel: Failed to get channel items Newtonsoft.Json.JsonReaderException: Could not convert string to DateTime: 0000-00-00. Path 'seasons[0].air_date', line 1, position 36. at Newtonsoft.Json.JsonReader.ReadDateTimeString(String s) at Newtonsoft.Json.JsonTextReader.FinishReadQuotedStringValue(ReadType readType) 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.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) 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) [20:45:30] [INF] [53] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.

Hey, having the same issue here. `[20:43:10] [ERR] [64] Jellyfin.Xtream.SeriesChannel: Failed to get channel items Newtonsoft.Json.JsonReaderException: Could not convert string to DateTime: 0000-00-00. Path 'seasons[0].air_date', line 1, position 36. at Newtonsoft.Json.JsonReader.ReadDateTimeString(String s) at Newtonsoft.Json.JsonTextReader.FinishReadQuotedStringValue(ReadType readType) 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.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) 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) [20:45:30] [INF] [53] Emby.Server.Implementations.Session.SessionWebSocketListener: Sending ForceKeepAlive message to 1 inactive WebSockets.`
Kevinjil commented 2025-07-01 18:13:54 +00:00 (Migrated from github.com)

Could anyone provide a JSON snippet of the API response for which this fails?

Could anyone provide a JSON snippet of the API response for which this fails?
ochan12 commented 2025-07-02 07:51:06 +00:00 (Migrated from github.com)

@Kevinjil In my case it would be the last season

{
....
  "seasons": [
    ....
    {
      "air_date": "2022-03-06",
      "episode_count": 8,
      "id": 215034,
      "name": "Book Six",
      "overview": "In season 6, Claire and Jamie continue their fight to protect those they love, as they navigate the trials and tribulations of life in colonial America.",
      "season_number": 6,
      "cover": "...",
      "cover_big": "...."
    },
    {
      "air_date": "2023-06-16",
      "episode_count": 8,
      "id": 295918,
      "name": "Book Seven",
      "overview": "In the seventh season, Jamie, Claire, and their family are caught in the violent birth pains of an emerging nation as armies march to war and British institutions crumble in the face of armed rebellion. In order to protect what they've built, the Frasers will have to navigate the perils of the Revolutionary War and learn that sometimes to defend what you love, you have to leave it behind. As the conflict draws them out of North Carolina and into the heart of this fight for independence, Jamie, Claire, Brianna, and Roger are faced with impossible decisions that have the potential to tear their family apart.",
      "season_number": 7,
      "cover": "....",
      "cover_big": "...."
    },
    {
      "air_date": null,
      "episode_count": 0,
      "id": 325144,
      "name": "Book Eight",
      "overview": "",
      "season_number": 8,
      "cover": "....",
      "cover_big": "...."
    }
  ]
}
@Kevinjil In my case it would be the last season ```json { .... "seasons": [ .... { "air_date": "2022-03-06", "episode_count": 8, "id": 215034, "name": "Book Six", "overview": "In season 6, Claire and Jamie continue their fight to protect those they love, as they navigate the trials and tribulations of life in colonial America.", "season_number": 6, "cover": "...", "cover_big": "...." }, { "air_date": "2023-06-16", "episode_count": 8, "id": 295918, "name": "Book Seven", "overview": "In the seventh season, Jamie, Claire, and their family are caught in the violent birth pains of an emerging nation as armies march to war and British institutions crumble in the face of armed rebellion. In order to protect what they've built, the Frasers will have to navigate the perils of the Revolutionary War and learn that sometimes to defend what you love, you have to leave it behind. As the conflict draws them out of North Carolina and into the heart of this fight for independence, Jamie, Claire, Brianna, and Roger are faced with impossible decisions that have the potential to tear their family apart.", "season_number": 7, "cover": "....", "cover_big": "...." }, { "air_date": null, "episode_count": 0, "id": 325144, "name": "Book Eight", "overview": "", "season_number": 8, "cover": "....", "cover_big": "...." } ] } ```
Sign in to join this conversation.
No Label help wanted
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sirherobrine23/Jellyfin_Xtream#151
No description provided.