Fix Json serialization error

This commit is contained in:
Bond_009
2019-10-15 17:49:49 +02:00
parent 0ccbc2f374
commit 5edb8159a7
45 changed files with 364 additions and 378 deletions

View File

@@ -2,13 +2,13 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.Json.Serialization;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Serialization;
namespace MediaBrowser.Controller.LiveTv
{
@@ -31,13 +31,13 @@ namespace MediaBrowser.Controller.LiveTv
return UnratedItem.LiveTvChannel;
}
[IgnoreDataMember]
[JsonIgnore]
public override bool SupportsPositionTicksResume => false;
[IgnoreDataMember]
[JsonIgnore]
public override SourceType SourceType => SourceType.LiveTV;
[IgnoreDataMember]
[JsonIgnore]
public override bool EnableRememberingTrackSelections => false;
/// <summary>
@@ -52,7 +52,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <value>The type of the channel.</value>
public ChannelType ChannelType { get; set; }
[IgnoreDataMember]
[JsonIgnore]
public override LocationType LocationType => LocationType.Remote;
protected override string CreateSortName()
@@ -70,7 +70,7 @@ namespace MediaBrowser.Controller.LiveTv
return (Number ?? string.Empty) + "-" + (Name ?? string.Empty);
}
[IgnoreDataMember]
[JsonIgnore]
public override string MediaType => ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video;
public override string GetClientTypeName()
@@ -119,45 +119,45 @@ namespace MediaBrowser.Controller.LiveTv
return false;
}
[IgnoreDataMember]
[JsonIgnore]
public bool IsMovie { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is sports.
/// </summary>
/// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsSports { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is series.
/// </summary>
/// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsSeries { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is news.
/// </summary>
/// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsNews { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is kids.
/// </summary>
/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase);
[IgnoreDataMember]
[JsonIgnore]
public bool IsRepeat { get; set; }
/// <summary>
/// Gets or sets the episode title.
/// </summary>
/// <value>The episode title.</value>
[IgnoreDataMember]
[JsonIgnore]
public string EpisodeTitle { get; set; }
}
}

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.Json.Serialization;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
@@ -9,7 +10,6 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Serialization;
namespace MediaBrowser.Controller.LiveTv
{
@@ -63,79 +63,79 @@ namespace MediaBrowser.Controller.LiveTv
}
}
[IgnoreDataMember]
[JsonIgnore]
public override SourceType SourceType => SourceType.LiveTV;
/// <summary>
/// The start date of the program, in UTC.
/// </summary>
[IgnoreDataMember]
[JsonIgnore]
public DateTime StartDate { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is repeat.
/// </summary>
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsRepeat { get; set; }
/// <summary>
/// Gets or sets the episode title.
/// </summary>
/// <value>The episode title.</value>
[IgnoreDataMember]
[JsonIgnore]
public string EpisodeTitle { get; set; }
[IgnoreDataMember]
[JsonIgnore]
public string ShowId { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is movie.
/// </summary>
/// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsMovie { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is sports.
/// </summary>
/// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsSports => Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Gets or sets a value indicating whether this instance is series.
/// </summary>
/// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsSeries { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is live.
/// </summary>
/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Gets or sets a value indicating whether this instance is news.
/// </summary>
/// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsNews => Tags.Contains("News", StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Gets or sets a value indicating whether this instance is kids.
/// </summary>
/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Gets or sets a value indicating whether this instance is premiere.
/// </summary>
/// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase);
/// <summary>
@@ -143,10 +143,10 @@ namespace MediaBrowser.Controller.LiveTv
/// If the item is a folder, it returns the folder itself
/// </summary>
/// <value>The containing folder path.</value>
[IgnoreDataMember]
[JsonIgnore]
public override string ContainingFolderPath => Path;
//[IgnoreDataMember]
//[JsonIgnore]
//public override string MediaType
//{
// get
@@ -155,7 +155,7 @@ namespace MediaBrowser.Controller.LiveTv
// }
//}
[IgnoreDataMember]
[JsonIgnore]
public bool IsAiring
{
get
@@ -166,7 +166,7 @@ namespace MediaBrowser.Controller.LiveTv
}
}
[IgnoreDataMember]
[JsonIgnore]
public bool HasAired
{
get
@@ -197,7 +197,7 @@ namespace MediaBrowser.Controller.LiveTv
return false;
}
[IgnoreDataMember]
[JsonIgnore]
public override bool SupportsPeople
{
get
@@ -212,7 +212,7 @@ namespace MediaBrowser.Controller.LiveTv
}
}
[IgnoreDataMember]
[JsonIgnore]
public override bool SupportsAncestors => false;
private LiveTvOptions GetConfiguration()

View File

@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Serialization;
namespace MediaBrowser.Controller.LiveTv
{
@@ -129,10 +129,10 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets a value indicating whether this instance is live.
/// </summary>
/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
[JsonIgnore]
public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase);
[IgnoreDataMember]
[JsonIgnore]
public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase);
public int? ProductionYear { get; set; }