diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-06-15 00:28:29 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-06-15 00:28:29 -0400 |
| commit | 7d9d57a36ecee8e8a74b92544166c8fe70a0f880 (patch) | |
| tree | a7f8a6bdb038048449d45a1e8926843015886f97 /MediaBrowser.Controller/LiveTv | |
| parent | 5aafbe3dd694813a4e68f21ee72e59d6c53e776a (diff) | |
| parent | 55eb54cbc28e40254a50c5a25443e910798243dc (diff) | |
Merge pull request #1118 from MediaBrowser/dev
3.0.5641.4
Diffstat (limited to 'MediaBrowser.Controller/LiveTv')
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvItem.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 28 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs | 20 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs | 31 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 20 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs | 31 |
6 files changed, 95 insertions, 41 deletions
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs b/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs index 6c277a2e19..36727f4aee 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvItem.cs @@ -1,10 +1,10 @@ -using System; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Controller.LiveTv { - public interface ILiveTvItem + public interface ILiveTvItem : IHasId { - Guid Id { get; } string ServiceName { get; set; } + string ExternalId { get; set; } } } diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index 53eb18e7a8..3aa1f66efb 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -79,7 +79,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="cancellationToken">The cancellation token.</param> /// <param name="user">The user.</param> /// <returns>Task{RecordingInfoDto}.</returns> - Task<RecordingInfoDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null); + Task<BaseItemDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null); /// <summary> /// Gets the channel. @@ -113,7 +113,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>QueryResult{RecordingInfoDto}.</returns> - Task<QueryResult<RecordingInfoDto>> GetRecordings(RecordingQuery query, DtoOptions options, CancellationToken cancellationToken); + Task<QueryResult<BaseItemDto>> GetRecordings(RecordingQuery query, DtoOptions options, CancellationToken cancellationToken); /// <summary> /// Gets the timers. @@ -170,7 +170,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="cancellationToken">The cancellation token.</param> /// <param name="user">The user.</param> /// <returns>Task{ProgramInfoDto}.</returns> - Task<ProgramInfoDto> GetProgram(string id, CancellationToken cancellationToken, User user = null); + Task<BaseItemDto> GetProgram(string id, CancellationToken cancellationToken, User user = null); /// <summary> /// Gets the programs. @@ -178,7 +178,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="query">The query.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>IEnumerable{ProgramInfo}.</returns> - Task<QueryResult<ProgramInfoDto>> GetPrograms(ProgramQuery query, CancellationToken cancellationToken); + Task<QueryResult<BaseItemDto>> GetPrograms(ProgramQuery query, CancellationToken cancellationToken); /// <summary> /// Updates the timer. @@ -218,7 +218,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="query">The query.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{QueryResult{RecordingGroupDto}}.</returns> - Task<QueryResult<RecordingGroupDto>> GetRecordingGroups(RecordingGroupQuery query, CancellationToken cancellationToken); + Task<QueryResult<BaseItemDto>> GetRecordingGroups(RecordingGroupQuery query, CancellationToken cancellationToken); /// <summary> /// Closes the live stream. @@ -240,7 +240,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="query">The query.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{QueryResult{ProgramInfoDto}}.</returns> - Task<QueryResult<ProgramInfoDto>> GetRecommendedPrograms(RecommendedProgramQuery query, + Task<QueryResult<BaseItemDto>> GetRecommendedPrograms(RecommendedProgramQuery query, CancellationToken cancellationToken); /// <summary> @@ -321,5 +321,21 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task<IEnumerable<MediaSourceInfo>>.</returns> Task<IEnumerable<MediaSourceInfo>> GetChannelMediaSources(string id, CancellationToken cancellationToken); + + /// <summary> + /// Adds the information to recording dto. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="dto">The dto.</param> + /// <param name="user">The user.</param> + void AddInfoToRecordingDto(BaseItem item, BaseItemDto dto, User user = null); + + /// <summary> + /// Adds the information to program dto. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="dto">The dto.</param> + /// <param name="user">The user.</param> + void AddInfoToProgramDto(BaseItem item, BaseItemDto dto, User user = null); } } diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs index 93e1e576ac..1dd267c939 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvRecording.cs @@ -2,19 +2,21 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Library; +using MediaBrowser.Model.LiveTv; +using System; using System.Threading; using System.Threading.Tasks; namespace MediaBrowser.Controller.LiveTv { - public interface ILiveTvRecording : IHasImages, IHasMediaSources, IHasUserData, ILiveTvItem + public interface ILiveTvRecording : IHasImages, IHasMediaSources, IHasUserData, ILiveTvItem, IHasStartDate, IHasProgramAttributes { + string ChannelId { get; } + string ProgramId { get; set; } string MediaType { get; } string Container { get; } - RecordingInfo RecordingInfo { get; set; } - long? RunTimeTicks { get; set; } string GetClientTypeName(); @@ -28,5 +30,17 @@ namespace MediaBrowser.Controller.LiveTv bool CanDelete(); bool CanDelete(User user); + + string ProviderImagePath { get; set; } + + string ProviderImageUrl { get; set; } + + 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; } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index 0dc296d5a5..3da12cd806 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -3,7 +3,9 @@ using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Users; +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; @@ -12,6 +14,27 @@ namespace MediaBrowser.Controller.LiveTv { public class LiveTvAudioRecording : Audio, ILiveTvRecording { + public string ExternalId { get; set; } + public string ProviderImagePath { get; set; } + public string ProviderImageUrl { get; set; } + public string EpisodeTitle { get; set; } + public bool IsSeries { get; set; } + public string SeriesTimerId { get; set; } + public DateTime StartDate { get; set; } + public RecordingStatus Status { get; set; } + public bool IsSports { get; set; } + public bool IsNews { get; set; } + public bool IsKids { get; set; } + public bool IsRepeat { get; set; } + public bool IsMovie { get; set; } + public bool? IsHD { get; set; } + public bool IsLive { get; set; } + public bool IsPremiere { get; set; } + public ChannelType ChannelType { get; set; } + public string ProgramId { get; set; } + public ProgramAudio? Audio { get; set; } + public DateTime? OriginalAirDate { get; set; } + /// <summary> /// Gets the user data key. /// </summary> @@ -20,16 +43,14 @@ namespace MediaBrowser.Controller.LiveTv { var name = GetClientTypeName(); - if (!string.IsNullOrEmpty(RecordingInfo.ProgramId)) + if (!string.IsNullOrEmpty(ProgramId)) { - return name + "-" + RecordingInfo.ProgramId; + return name + "-" + ProgramId; } - return name + "-" + RecordingInfo.Name + (RecordingInfo.EpisodeTitle ?? string.Empty); + return name + "-" + Name + (EpisodeTitle ?? string.Empty); } - public RecordingInfo RecordingInfo { get; set; } - public string ServiceName { get; set; } /// <summary> diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 0609df4c6b..8232c5c7ad 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -1,5 +1,4 @@ using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.LiveTv; @@ -7,12 +6,10 @@ using MediaBrowser.Model.Users; using System; using System.Linq; using System.Runtime.Serialization; -using System.Threading; -using System.Threading.Tasks; namespace MediaBrowser.Controller.LiveTv { - public class LiveTvProgram : BaseItem, ILiveTvItem, IHasLookupInfo<LiveTvProgramLookupInfo> + public class LiveTvProgram : BaseItem, ILiveTvItem, IHasLookupInfo<LiveTvProgramLookupInfo>, IHasStartDate, IHasProgramAttributes { /// <summary> /// Gets the user data key. @@ -29,12 +26,6 @@ namespace MediaBrowser.Controller.LiveTv public string ExternalId { get; set; } /// <summary> - /// Gets or sets the channel identifier. - /// </summary> - /// <value>The channel identifier.</value> - public string ExternalChannelId { get; set; } - - /// <summary> /// Gets or sets the original air date. /// </summary> /// <value>The original air date.</value> @@ -204,15 +195,6 @@ namespace MediaBrowser.Controller.LiveTv return "Program"; } - public override Task UpdateToRepository(ItemUpdateType updateReason, CancellationToken cancellationToken) - { - DateLastSaved = DateTime.UtcNow; - - // Avoid library manager and keep out of in-memory cache - // Not great that this class has to know about that, but we'll improve that later. - return ItemRepository.SaveItem(this, cancellationToken); - } - protected override bool GetBlockUnratedValue(UserPolicy config) { return config.BlockUnratedItems.Contains(UnratedItem.LiveTvProgram); diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index 3669f94403..179c33d09f 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -2,7 +2,9 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Users; +using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; @@ -11,6 +13,27 @@ namespace MediaBrowser.Controller.LiveTv { public class LiveTvVideoRecording : Video, ILiveTvRecording { + public string ExternalId { get; set; } + public string ProviderImagePath { get; set; } + public string ProviderImageUrl { get; set; } + public string EpisodeTitle { get; set; } + public bool IsSeries { get; set; } + public string SeriesTimerId { get; set; } + public DateTime StartDate { get; set; } + public RecordingStatus Status { get; set; } + public bool IsSports { get; set; } + public bool IsNews { get; set; } + public bool IsKids { get; set; } + public bool IsRepeat { get; set; } + public bool IsMovie { get; set; } + public bool? IsHD { get; set; } + public bool IsLive { get; set; } + public bool IsPremiere { get; set; } + public ChannelType ChannelType { get; set; } + public string ProgramId { get; set; } + public ProgramAudio? Audio { get; set; } + public DateTime? OriginalAirDate { get; set; } + /// <summary> /// Gets the user data key. /// </summary> @@ -19,16 +42,14 @@ namespace MediaBrowser.Controller.LiveTv { var name = GetClientTypeName(); - if (!string.IsNullOrEmpty(RecordingInfo.ProgramId)) + if (!string.IsNullOrEmpty(ProgramId)) { - return name + "-" + RecordingInfo.ProgramId; + return name + "-" + ProgramId; } - return name + "-" + RecordingInfo.Name + (RecordingInfo.EpisodeTitle ?? string.Empty); + return name + "-" + Name + (EpisodeTitle ?? string.Empty); } - public RecordingInfo RecordingInfo { get; set; } - public string ServiceName { get; set; } [IgnoreDataMember] |
