From 145285784bfb6a2fcd0e9234d569d7ad5083516f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 23 Jan 2014 13:05:41 -0500 Subject: trim tv objects --- MediaBrowser.Controller/LiveTv/LiveTvChannel.cs | 42 ++++++++- MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 112 +++++++++++++++++++++++- MediaBrowser.Controller/LiveTv/ProgramInfo.cs | 18 ++-- 3 files changed, 153 insertions(+), 19 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 1e6d74ce82..f37e947140 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -25,17 +25,51 @@ namespace MediaBrowser.Controller.LiveTv [IgnoreDataMember] public List UserItemCountList { get; set; } - public ChannelInfo ChannelInfo { get; set; } + /// + /// Gets or sets the number. + /// + /// The number. + public string Number { get; set; } + + /// + /// Gets or sets the external identifier. + /// + /// The external identifier. + public string ExternalId { get; set; } + + /// + /// Gets or sets the type of the channel. + /// + /// The type of the channel. + public ChannelType ChannelType { get; set; } public string ServiceName { get; set; } + /// + /// Supply the image path if it can be accessed directly from the file system + /// + /// The image path. + public string ProviderImagePath { get; set; } + + /// + /// Supply the image url if it can be downloaded + /// + /// The image URL. + public string ProviderImageUrl { get; set; } + + /// + /// Gets or sets a value indicating whether this instance has image. + /// + /// null if [has image] contains no value, true if [has image]; otherwise, false. + public bool? HasProviderImage { get; set; } + protected override string CreateSortName() { double number = 0; - if (!string.IsNullOrEmpty(ChannelInfo.Number)) + if (!string.IsNullOrEmpty(Number)) { - double.TryParse(ChannelInfo.Number, out number); + double.TryParse(Number, out number); } return number.ToString("000-") + (Name ?? string.Empty); @@ -45,7 +79,7 @@ namespace MediaBrowser.Controller.LiveTv { get { - return ChannelInfo.ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; + return ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index aceb32885e..6a00607e41 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -15,12 +15,118 @@ namespace MediaBrowser.Controller.LiveTv return GetClientTypeName() + "-" + Name; } - public ProgramInfo ProgramInfo { get; set; } + /// + /// Id of the program. + /// + public string ExternalId { get; set; } + /// + /// Gets or sets the channel identifier. + /// + /// The channel identifier. + public string ExternalChannelId { get; set; } + + /// + /// Gets or sets the type of the channel. + /// + /// The type of the channel. public ChannelType ChannelType { get; set; } + /// + /// The start date of the program, in UTC. + /// + public DateTime StartDate { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is hd. + /// + /// true if this instance is hd; otherwise, false. + public bool? IsHD { get; set; } + + /// + /// Gets or sets the audio. + /// + /// The audio. + public ProgramAudio? Audio { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is repeat. + /// + /// true if this instance is repeat; otherwise, false. + public bool IsRepeat { get; set; } + + /// + /// Gets or sets the episode title. + /// + /// The episode title. + public string EpisodeTitle { get; set; } + + /// + /// Gets or sets the name of the service. + /// + /// The name of the service. public string ServiceName { get; set; } + /// + /// Supply the image path if it can be accessed directly from the file system + /// + /// The image path. + public string ProviderImagePath { get; set; } + + /// + /// Supply the image url if it can be downloaded + /// + /// The image URL. + public string ProviderImageUrl { get; set; } + + /// + /// Gets or sets a value indicating whether this instance has image. + /// + /// null if [has image] contains no value, true if [has image]; otherwise, false. + public bool? HasProviderImage { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is movie. + /// + /// true if this instance is movie; otherwise, false. + public bool IsMovie { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is sports. + /// + /// true if this instance is sports; otherwise, false. + public bool IsSports { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is series. + /// + /// true if this instance is series; otherwise, false. + public bool IsSeries { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is live. + /// + /// true if this instance is live; otherwise, false. + public bool IsLive { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is news. + /// + /// true if this instance is news; otherwise, false. + public bool IsNews { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is kids. + /// + /// true if this instance is kids; otherwise, false. + public bool IsKids { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is premiere. + /// + /// true if this instance is premiere; otherwise, false. + public bool IsPremiere { get; set; } + public override string MediaType { get @@ -35,7 +141,7 @@ namespace MediaBrowser.Controller.LiveTv { var now = DateTime.UtcNow; - return now >= ProgramInfo.StartDate && now < ProgramInfo.EndDate; + return now >= StartDate && now < EndDate; } } @@ -45,7 +151,7 @@ namespace MediaBrowser.Controller.LiveTv { var now = DateTime.UtcNow; - return now >= ProgramInfo.EndDate; + return now >= EndDate; } } diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index 0368c5f2f6..4d7e5ee63e 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -17,12 +17,6 @@ namespace MediaBrowser.Controller.LiveTv /// The channel identifier. public string ChannelId { get; set; } - /// - /// Gets or sets the channel primary image tag. - /// - /// The channel primary image tag. - public Guid? ChannelPrimaryImageTag { get; set; } - /// /// Name of the program /// @@ -103,6 +97,12 @@ namespace MediaBrowser.Controller.LiveTv /// The image URL. public string ImageUrl { get; set; } + /// + /// Gets or sets a value indicating whether this instance has image. + /// + /// null if [has image] contains no value, true if [has image]; otherwise, false. + public bool? HasImage { get; set; } + /// /// Gets or sets a value indicating whether this instance is movie. /// @@ -145,12 +145,6 @@ namespace MediaBrowser.Controller.LiveTv /// true if this instance is premiere; otherwise, false. public bool IsPremiere { get; set; } - /// - /// Gets or sets a value indicating whether this instance has image. - /// - /// null if [has image] contains no value, true if [has image]; otherwise, false. - public bool? HasImage { get; set; } - public ProgramInfo() { Genres = new List(); -- cgit v1.2.3