using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; using MediaBrowser.Model.LiveTv; using System; using System.Collections.Generic; using System.Runtime.Serialization; namespace MediaBrowser.Controller.LiveTv { public class Channel : BaseItem, IItemByName { public Channel() { UserItemCountList = new List(); } /// /// Gets the user data key. /// /// System.String. public override string GetUserDataKey() { return "Channel-" + Name; } [IgnoreDataMember] public List UserItemCountList { get; set; } /// /// Gets or sets the number. /// /// The number. public string ChannelNumber { get; set; } /// /// Get or sets the Id. /// /// The id of the channel. public string ChannelId { get; set; } /// /// Gets or sets the name of the service. /// /// The name of the service. public string ServiceName { get; set; } /// /// Gets or sets the type of the channel. /// /// The type of the channel. public ChannelType ChannelType { get; set; } public bool? HasProviderImage { get; set; } protected override string CreateSortName() { double number = 0; if (!string.IsNullOrEmpty(ChannelNumber)) { double.TryParse(ChannelNumber, out number); } return number.ToString("000-") + (Name ?? string.Empty); } public override string MediaType { get { return ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video; } } } }