diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-26 16:36:11 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-11-26 16:36:11 -0500 |
| commit | e05a84c789641966b49e780ea6111126a1102a86 (patch) | |
| tree | 77211c60a554fb1af552b8ea118b1e0080adc85c /MediaBrowser.Controller | |
| parent | af49f6d2320f1b73396b9733275e48bb2b8a4e52 (diff) | |
updated nuget for live tv
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/MusicArtist.cs | 15 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ChannelInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 18 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvService.cs | 33 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ProgramInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/RecordingInfo.cs | 33 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/TimerInfo.cs | 67 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaBrowser.Controller.csproj | 1 |
8 files changed, 125 insertions, 54 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs index a234844ff6..8ebfe17e41 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs @@ -3,6 +3,8 @@ using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; using System.Runtime.Serialization; +using System.Threading; +using System.Threading.Tasks; namespace MediaBrowser.Controller.Entities.Audio { @@ -30,13 +32,24 @@ namespace MediaBrowser.Controller.Entities.Audio { if (IsAccessedByName) { - throw new InvalidOperationException("Artists accessed by name do not have children."); + return new List<BaseItem>(); } return base.ActualChildren; } } + protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool? recursive = null, bool forceRefreshMetadata = false) + { + if (IsAccessedByName) + { + // Should never get in here anyway + return Task.FromResult(true); + } + + return base.ValidateChildrenInternal(progress, cancellationToken, recursive, forceRefreshMetadata); + } + public override string GetClientTypeName() { if (IsAccessedByName) diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs index 721c1e40a8..27fc596303 100644 --- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs @@ -26,12 +26,6 @@ namespace MediaBrowser.Controller.LiveTv public string Id { get; set; } /// <summary> - /// Gets or sets the name of the service. - /// </summary> - /// <value>The name of the service.</value> - public string ServiceName { get; set; } - - /// <summary> /// Gets or sets the type of the channel. /// </summary> /// <value>The type of the channel.</value> diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index 9e49813318..a04072d28d 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -1,6 +1,8 @@ -using MediaBrowser.Model.LiveTv; +using System.Threading; +using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Querying; using System.Collections.Generic; +using System.Threading.Tasks; namespace MediaBrowser.Controller.LiveTv { @@ -16,6 +18,13 @@ namespace MediaBrowser.Controller.LiveTv IReadOnlyList<ILiveTvService> Services { get; } /// <summary> + /// Schedules the recording. + /// </summary> + /// <param name="programId">The program identifier.</param> + /// <returns>Task.</returns> + Task ScheduleRecording(string programId); + + /// <summary> /// Adds the parts. /// </summary> /// <param name="services">The services.</param> @@ -31,8 +40,10 @@ namespace MediaBrowser.Controller.LiveTv /// <summary> /// Gets the recordings. /// </summary> + /// <param name="query">The query.</param> + /// <param name="cancellationToken">The cancellation token.</param> /// <returns>QueryResult{RecordingInfoDto}.</returns> - QueryResult<RecordingInfoDto> GetRecordings(); + Task<QueryResult<RecordingInfoDto>> GetRecordings(RecordingQuery query, CancellationToken cancellationToken); /// <summary> /// Gets the channel. @@ -53,7 +64,8 @@ namespace MediaBrowser.Controller.LiveTv /// Gets the programs. /// </summary> /// <param name="query">The query.</param> + /// <param name="cancellationToken">The cancellation token.</param> /// <returns>IEnumerable{ProgramInfo}.</returns> - QueryResult<ProgramInfoDto> GetPrograms(ProgramQuery query); + Task<QueryResult<ProgramInfoDto>> GetPrograms(ProgramQuery query, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index 4e4f8dcc78..e903ad5ec6 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -1,5 +1,4 @@ using MediaBrowser.Common.Net; -using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -25,12 +24,12 @@ namespace MediaBrowser.Controller.LiveTv Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken); /// <summary> - /// Cancels the recording asynchronous. + /// Cancels the timer asynchronous. /// </summary> - /// <param name="recordingId">The recording identifier.</param> + /// <param name="timerId">The timer identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task.</returns> - Task CancelRecordingAsync(string recordingId, CancellationToken cancellationToken); + Task CancelTimerAsync(string timerId, CancellationToken cancellationToken); /// <summary> /// Deletes the recording asynchronous. @@ -39,19 +38,24 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task.</returns> Task DeleteRecordingAsync(string recordingId, CancellationToken cancellationToken); - + /// <summary> - /// Schedules the recording asynchronous. + /// Creates the timer asynchronous. /// </summary> - /// <param name="name">The name for the recording</param> - /// <param name="channelId">The channel identifier.</param> - /// <param name="startTime">The start time.</param> - /// <param name="duration">The duration.</param> + /// <param name="info">The information.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task.</returns> - Task ScheduleRecordingAsync(string name, string channelId, DateTime startTime, TimeSpan duration, CancellationToken cancellationToken); + Task CreateTimerAsync(TimerInfo info, CancellationToken cancellationToken); /// <summary> + /// Updates the timer asynchronous. + /// </summary> + /// <param name="info">The information.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task.</returns> + Task UpdateTimerAsync(TimerInfo info, CancellationToken cancellationToken); + + /// <summary> /// Gets the channel image asynchronous. /// </summary> /// <param name="channelId">The channel identifier.</param> @@ -67,6 +71,13 @@ namespace MediaBrowser.Controller.LiveTv Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(CancellationToken cancellationToken); /// <summary> + /// Gets the recordings asynchronous. + /// </summary> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{IEnumerable{RecordingInfo}}.</returns> + Task<IEnumerable<TimerInfo>> GetTimersAsync(CancellationToken cancellationToken); + + /// <summary> /// Gets the programs asynchronous. /// </summary> /// <param name="channelId">The channel identifier.</param> diff --git a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs index f6df495459..58a15be3e5 100644 --- a/MediaBrowser.Controller/LiveTv/ProgramInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ProgramInfo.cs @@ -44,6 +44,12 @@ namespace MediaBrowser.Controller.LiveTv public DateTime EndDate { get; set; } /// <summary> + /// Gets or sets the aspect ratio. + /// </summary> + /// <value>The aspect ratio.</value> + public string AspectRatio { get; set; } + + /// <summary> /// Genre of the program. /// </summary> public List<string> Genres { get; set; } diff --git a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs index f61bd9e785..f0daac5f91 100644 --- a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs +++ b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.LiveTv; using System; -using System.Collections.Generic; namespace MediaBrowser.Controller.LiveTv { @@ -20,12 +19,6 @@ namespace MediaBrowser.Controller.LiveTv /// ChannelName of the recording. /// </summary> public string ChannelName { get; set; } - - /// <summary> - /// Gets or sets the program identifier. - /// </summary> - /// <value>The program identifier.</value> - public string ProgramId { get; set; } /// <summary> /// Name of the recording. @@ -52,31 +45,5 @@ namespace MediaBrowser.Controller.LiveTv /// </summary> /// <value>The status.</value> public RecordingStatus Status { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance is recurring. - /// </summary> - /// <value><c>true</c> if this instance is recurring; otherwise, <c>false</c>.</value> - public bool IsRecurring { get; set; } - - /// <summary> - /// Parent recurring. - /// </summary> - public string RecurringParent { get; set; } - - /// <summary> - /// Start date for the recurring, in UTC. - /// </summary> - public DateTime RecurrringStartDate { get; set; } - - /// <summary> - /// End date for the recurring, in UTC - /// </summary> - public DateTime RecurringEndDate { get; set; } - - /// <summary> - /// When do we need the recording? - /// </summary> - public List<string> DayMask { get; set; } } } diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.cs new file mode 100644 index 0000000000..f0f936b526 --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs @@ -0,0 +1,67 @@ +using MediaBrowser.Model.LiveTv; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Controller.LiveTv +{ + public class TimerInfo + { + /// <summary> + /// Id of the recording. + /// </summary> + public string Id { get; set; } + + /// <summary> + /// ChannelId of the recording. + /// </summary> + public string ChannelId { get; set; } + + /// <summary> + /// ChannelName of the recording. + /// </summary> + public string ChannelName { get; set; } + + /// <summary> + /// Name of the recording. + /// </summary> + public string Name { get; set; } + + /// <summary> + /// Description of the recording. + /// </summary> + public string Description { get; set; } + + /// <summary> + /// The start date of the recording, in UTC. + /// </summary> + public DateTime StartDate { get; set; } + + /// <summary> + /// The end date of the recording, in UTC. + /// </summary> + public DateTime EndDate { get; set; } + + /// <summary> + /// Gets or sets the status. + /// </summary> + /// <value>The status.</value> + public RecordingStatus Status { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is recurring. + /// </summary> + /// <value><c>true</c> if this instance is recurring; otherwise, <c>false</c>.</value> + public bool IsRecurring { get; set; } + + /// <summary> + /// Gets or sets the recurring days. + /// </summary> + /// <value>The recurring days.</value> + public List<DayOfWeek> RecurringDays { get; set; } + + public TimerInfo() + { + RecurringDays = new List<DayOfWeek>(); + } + } +} diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index ed63bc1647..2068fccf83 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -110,6 +110,7 @@ <Compile Include="LiveTv\ILiveTvService.cs" /> <Compile Include="LiveTv\ProgramInfo.cs" /> <Compile Include="LiveTv\RecordingInfo.cs" /> + <Compile Include="LiveTv\TimerInfo.cs" /> <Compile Include="Localization\ILocalizationManager.cs" /> <Compile Include="Notifications\INotificationsRepository.cs" /> <Compile Include="Notifications\NotificationUpdateEventArgs.cs" /> |
