diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-09-02 11:50:00 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-09-02 11:50:00 -0400 |
| commit | f868dd81e856488280978006cbb67afc2677049d (patch) | |
| tree | 616ba8ae846efe9ec889abeb12f6b2702c6b8592 /MediaBrowser.Controller/LiveTv | |
| parent | af89446c20fb302087b82c18c28da92076dbc5ac (diff) | |
| parent | e6d5901408ba7d8e344a27ea1f3b0046c40e56c1 (diff) | |
Merge pull request #1164 from MediaBrowser/dev
3.0.5724.1
Diffstat (limited to 'MediaBrowser.Controller/LiveTv')
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ChannelInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/IHasRegistrationInfo.cs | 15 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/IListingsProvider.cs | 19 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 66 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ITunerHost.cs | 55 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 30 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ProgramInfo.cs | 35 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/RecordingInfo.cs | 16 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs | 6 |
12 files changed, 257 insertions, 14 deletions
diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs index cdc9c76c8..32b8abdc5 100644 --- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs @@ -48,6 +48,10 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value><c>null</c> if [has image] contains no value, <c>true</c> if [has image]; otherwise, <c>false</c>.</value> public bool? HasImage { get; set; } - + /// <summary> + /// Gets or sets a value indicating whether this instance is favorite. + /// </summary> + /// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value> + public bool? IsFavorite { get; set; } } } diff --git a/MediaBrowser.Controller/LiveTv/IHasRegistrationInfo.cs b/MediaBrowser.Controller/LiveTv/IHasRegistrationInfo.cs new file mode 100644 index 000000000..3626c18e5 --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/IHasRegistrationInfo.cs @@ -0,0 +1,15 @@ +using MediaBrowser.Model.Entities; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.LiveTv +{ + public interface IHasRegistrationInfo + { + /// <summary> + /// Gets the registration information. + /// </summary> + /// <param name="feature">The feature.</param> + /// <returns>Task<MBRegistrationRecord>.</returns> + Task<MBRegistrationRecord> GetRegistrationInfo(string feature); + } +} diff --git a/MediaBrowser.Controller/LiveTv/IListingsProvider.cs b/MediaBrowser.Controller/LiveTv/IListingsProvider.cs new file mode 100644 index 000000000..e60183bd9 --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/IListingsProvider.cs @@ -0,0 +1,19 @@ +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.LiveTv; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.LiveTv +{ + public interface IListingsProvider + { + string Name { get; } + string Type { get; } + Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken); + Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken); + Task Validate(ListingsProviderInfo info, bool validateLogin, bool validateListings); + Task<List<NameIdPair>> GetLineups(ListingsProviderInfo info, string country, string location); + } +} diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index 3aa1f66ef..1458c1bc2 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -2,6 +2,7 @@ using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Querying; using System.Collections.Generic; @@ -56,20 +57,23 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="id">The identifier.</param> /// <returns>Task.</returns> Task CancelSeriesTimer(string id); - + /// <summary> /// Adds the parts. /// </summary> /// <param name="services">The services.</param> - void AddParts(IEnumerable<ILiveTvService> services); + /// <param name="tunerHosts">The tuner hosts.</param> + /// <param name="listingProviders">The listing providers.</param> + void AddParts(IEnumerable<ILiveTvService> services, IEnumerable<ITunerHost> tunerHosts, IEnumerable<IListingsProvider> listingProviders); /// <summary> /// Gets the channels. /// </summary> /// <param name="query">The query.</param> + /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>IEnumerable{Channel}.</returns> - Task<QueryResult<ChannelInfoDto>> GetChannels(LiveTvChannelQuery query, CancellationToken cancellationToken); + Task<QueryResult<ChannelInfoDto>> GetChannels(LiveTvChannelQuery query, DtoOptions options, CancellationToken cancellationToken); /// <summary> /// Gets the recording. @@ -171,14 +175,15 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="user">The user.</param> /// <returns>Task{ProgramInfoDto}.</returns> Task<BaseItemDto> GetProgram(string id, CancellationToken cancellationToken, User user = null); - + /// <summary> /// Gets the programs. /// </summary> /// <param name="query">The query.</param> + /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>IEnumerable{ProgramInfo}.</returns> - Task<QueryResult<BaseItemDto>> GetPrograms(ProgramQuery query, CancellationToken cancellationToken); + Task<QueryResult<BaseItemDto>> GetPrograms(ProgramQuery query, DtoOptions options, CancellationToken cancellationToken); /// <summary> /// Updates the timer. @@ -238,10 +243,10 @@ namespace MediaBrowser.Controller.LiveTv /// Gets the recommended programs. /// </summary> /// <param name="query">The query.</param> + /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{QueryResult{ProgramInfoDto}}.</returns> - Task<QueryResult<BaseItemDto>> GetRecommendedPrograms(RecommendedProgramQuery query, - CancellationToken cancellationToken); + Task<QueryResult<BaseItemDto>> GetRecommendedPrograms(RecommendedProgramQuery query, DtoOptions options, CancellationToken cancellationToken); /// <summary> /// Gets the recommended programs internal. @@ -249,8 +254,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="query">The query.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task<QueryResult<LiveTvProgram>>.</returns> - Task<QueryResult<LiveTvProgram>> GetRecommendedProgramsInternal(RecommendedProgramQuery query, - CancellationToken cancellationToken); + Task<QueryResult<LiveTvProgram>> GetRecommendedProgramsInternal(RecommendedProgramQuery query, CancellationToken cancellationToken); /// <summary> /// Gets the live tv information. @@ -270,10 +274,9 @@ namespace MediaBrowser.Controller.LiveTv /// <summary> /// Gets the live tv folder. /// </summary> - /// <param name="userId">The user identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>BaseItemDto.</returns> - Task<Folder> GetInternalLiveTvFolder(string userId, CancellationToken cancellationToken); + Task<Folder> GetInternalLiveTvFolder(CancellationToken cancellationToken); /// <summary> /// Gets the live tv folder. @@ -337,5 +340,46 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="dto">The dto.</param> /// <param name="user">The user.</param> void AddInfoToProgramDto(BaseItem item, BaseItemDto dto, User user = null); + /// <summary> + /// Saves the tuner host. + /// </summary> + /// <param name="info">The information.</param> + /// <returns>Task.</returns> + Task<TunerHostInfo> SaveTunerHost(TunerHostInfo info); + /// <summary> + /// Saves the listing provider. + /// </summary> + /// <param name="info">The information.</param> + /// <param name="validateLogin">if set to <c>true</c> [validate login].</param> + /// <param name="validateListings">if set to <c>true</c> [validate listings].</param> + /// <returns>Task.</returns> + Task<ListingsProviderInfo> SaveListingProvider(ListingsProviderInfo info, bool validateLogin, bool validateListings); + /// <summary> + /// Gets the lineups. + /// </summary> + /// <param name="providerType">Type of the provider.</param> + /// <param name="providerId">The provider identifier.</param> + /// <param name="country">The country.</param> + /// <param name="location">The location.</param> + /// <returns>Task<List<NameIdPair>>.</returns> + Task<List<NameIdPair>> GetLineups(string providerType, string providerId, string country, string location); + + /// <summary> + /// Gets the registration information. + /// </summary> + /// <param name="channelId">The channel identifier.</param> + /// <param name="programId">The program identifier.</param> + /// <param name="feature">The feature.</param> + /// <returns>Task<MBRegistrationRecord>.</returns> + Task<MBRegistrationRecord> GetRegistrationInfo(string channelId, string programId, string feature); + + /// <summary> + /// Adds the channel information. + /// </summary> + /// <param name="dto">The dto.</param> + /// <param name="channel">The channel.</param> + /// <param name="options">The options.</param> + /// <param name="user">The user.</param> + void AddChannelInfo(BaseItemDto dto, LiveTvChannel channel, DtoOptions options, User user); } } diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs index 1dd267c93..ba0b82a0b 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs @@ -37,10 +37,12 @@ namespace MediaBrowser.Controller.LiveTv string ExternalId { get; set; } string EpisodeTitle { get; set; } - bool IsSeries { get; set; } string SeriesTimerId { get; set; } RecordingStatus Status { get; set; } DateTime? EndDate { get; set; } ChannelType ChannelType { get; set; } + DateTime DateLastSaved { get; set; } + DateTime DateCreated { get; set; } + DateTime DateModified { get; set; } } } diff --git a/MediaBrowser.Controller/LiveTv/ITunerHost.cs b/MediaBrowser.Controller/LiveTv/ITunerHost.cs new file mode 100644 index 000000000..bedbcffe3 --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/ITunerHost.cs @@ -0,0 +1,55 @@ +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.LiveTv; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.LiveTv +{ + public interface ITunerHost + { + /// <summary> + /// Gets the name. + /// </summary> + /// <value>The name.</value> + string Name { get; } + /// <summary> + /// Gets the type. + /// </summary> + /// <value>The type.</value> + string Type { get; } + /// <summary> + /// Gets the channels. + /// </summary> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task<IEnumerable<ChannelInfo>>.</returns> + Task<IEnumerable<ChannelInfo>> GetChannels(CancellationToken cancellationToken); + /// <summary> + /// Gets the tuner infos. + /// </summary> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task<List<LiveTvTunerInfo>>.</returns> + Task<List<LiveTvTunerInfo>> GetTunerInfos(CancellationToken cancellationToken); + /// <summary> + /// Gets the channel stream. + /// </summary> + /// <param name="channelId">The channel identifier.</param> + /// <param name="streamId">The stream identifier.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task<MediaSourceInfo>.</returns> + Task<MediaSourceInfo> GetChannelStream(string channelId, string streamId, CancellationToken cancellationToken); + /// <summary> + /// Gets the channel stream media sources. + /// </summary> + /// <param name="channelId">The channel identifier.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task<List<MediaSourceInfo>>.</returns> + Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken); + /// <summary> + /// Validates the specified information. + /// </summary> + /// <param name="info">The information.</param> + /// <returns>Task.</returns> + Task Validate(TunerHostInfo info); + } +} diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 8232c5c7a..12052905f 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -1,4 +1,5 @@ using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.LiveTv; @@ -17,10 +18,25 @@ namespace MediaBrowser.Controller.LiveTv /// <returns>System.String.</returns> protected override string CreateUserDataKey() { + if (IsMovie) + { + var key = Movie.GetMovieUserDataKey(this); + + if (!string.IsNullOrWhiteSpace(key)) + { + return key; + } + } return GetClientTypeName() + "-" + Name; } /// <summary> + /// Gets or sets the etag. + /// </summary> + /// <value>The etag.</value> + public string Etag { get; set; } + + /// <summary> /// Id of the program. /// </summary> public string ExternalId { get; set; } @@ -227,5 +243,19 @@ namespace MediaBrowser.Controller.LiveTv info.IsMovie = IsMovie; return info; } + + public override bool SupportsPeople + { + get + { + // Optimization + if (IsNews || IsSports) + { + return false; + } + + return base.SupportsPeople; + } + } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs index 0cb064aba..4da238acf 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvServiceStatusInfo.cs @@ -34,10 +34,16 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value>The tuners.</value> public List<LiveTvTunerInfo> Tuners { get; set; } - + /// <summary> + /// Gets or sets a value indicating whether this instance is visible. + /// </summary> + /// <value><c>true</c> if this instance is visible; otherwise, <c>false</c>.</value> + public bool IsVisible { get; set; } + public LiveTvServiceStatusInfo() { Tuners = new List<LiveTvTunerInfo>(); + IsVisible = true; } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index aaaff6bdb..960f8054a 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -1,4 +1,5 @@ using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; @@ -40,6 +41,16 @@ namespace MediaBrowser.Controller.LiveTv /// <returns>System.String.</returns> protected override string CreateUserDataKey() { + if (IsMovie) + { + var key = Movie.GetMovieUserDataKey(this); + + if (!string.IsNullOrWhiteSpace(key)) + { + return key; + } + } + var name = GetClientTypeName(); if (!string.IsNullOrEmpty(ProgramId)) diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index 36f082b02..a6a3e6108 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -33,6 +33,11 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value>The overview.</value> public string Overview { get; set; } + /// <summary> + /// Gets or sets the short overview. + /// </summary> + /// <value>The short overview.</value> + public string ShortOverview { get; set; } /// <summary> /// The start date of the program, in UTC. @@ -150,6 +155,36 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value>The production year.</value> public int? ProductionYear { get; set; } + /// <summary> + /// Gets or sets the home page URL. + /// </summary> + /// <value>The home page URL.</value> + public string HomePageUrl { get; set; } + /// <summary> + /// Gets or sets the series identifier. + /// </summary> + /// <value>The series identifier.</value> + public string SeriesId { get; set; } + /// <summary> + /// Gets or sets the show identifier. + /// </summary> + /// <value>The show identifier.</value> + public string ShowId { get; set; } + /// <summary> + /// Gets or sets the season number. + /// </summary> + /// <value>The season number.</value> + public int? SeasonNumber { get; set; } + /// <summary> + /// Gets or sets the episode number. + /// </summary> + /// <value>The episode number.</value> + public int? EpisodeNumber { get; set; } + /// <summary> + /// Gets or sets the etag. + /// </summary> + /// <value>The etag.</value> + public string Etag { get; set; } public ProgramInfo() { diff --git a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs index bf453ccf4..3006b9bbe 100644 --- a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs +++ b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs @@ -16,6 +16,12 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value>The series timer identifier.</value> public string SeriesTimerId { get; set; } + + /// <summary> + /// Gets or sets the timer identifier. + /// </summary> + /// <value>The timer identifier.</value> + public string TimerId { get; set; } /// <summary> /// ChannelId of the recording. @@ -179,7 +185,17 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value><c>null</c> if [has image] contains no value, <c>true</c> if [has image]; otherwise, <c>false</c>.</value> public bool? HasImage { get; set; } + /// <summary> + /// Gets or sets the show identifier. + /// </summary> + /// <value>The show identifier.</value> + public string ShowId { get; set; } + /// <summary> + /// Gets or sets the date last updated. + /// </summary> + /// <value>The date last updated.</value> + public DateTime DateLastUpdated { get; set; } public RecordingInfo() { diff --git a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs index 1be6549ff..2d79473f0 100644 --- a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs @@ -94,6 +94,12 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value><c>true</c> if this instance is post padding required; otherwise, <c>false</c>.</value> public bool IsPostPaddingRequired { get; set; } + + /// <summary> + /// Gets or sets the series identifier. + /// </summary> + /// <value>The series identifier.</value> + public string SeriesId { get; set; } public SeriesTimerInfo() { |
