From 01e65c93eeeddff27fc2e0e4833678c5cc2829a0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 14 Dec 2013 20:17:57 -0500 Subject: updated live tv + nuget --- MediaBrowser.Controller/IServerApplicationPaths.cs | 8 +- MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 56 +++++++++-- MediaBrowser.Controller/LiveTv/ILiveTvService.cs | 11 ++- .../LiveTv/ImageResponseInfo.cs | 6 -- MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs | 42 +++++--- .../Providers/BaseItemXmlParser.cs | 108 +++++---------------- 6 files changed, 108 insertions(+), 123 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/IServerApplicationPaths.cs b/MediaBrowser.Controller/IServerApplicationPaths.cs index 57cb7c7dd..f8b78299c 100644 --- a/MediaBrowser.Controller/IServerApplicationPaths.cs +++ b/MediaBrowser.Controller/IServerApplicationPaths.cs @@ -26,7 +26,7 @@ namespace MediaBrowser.Controller /// Gets the path to the Images By Name directory /// /// The images by name path. - string ItemsByNamePath { get; set; } + string ItemsByNamePath { get; } /// /// Gets the path to the People directory @@ -51,13 +51,13 @@ namespace MediaBrowser.Controller /// /// The game genre path. string GameGenrePath { get; } - + /// /// Gets the artists path. /// /// The artists path. string ArtistsPath { get; } - + /// /// Gets the path to the Studio directory /// @@ -87,7 +87,7 @@ namespace MediaBrowser.Controller /// /// The media info images path. string MediaInfoImagesPath { get; } - + /// /// Gets the path to the user configuration directory /// diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index b8dfbe05d..9ed7b633d 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Model.LiveTv; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.LiveTv; using MediaBrowser.Model.Querying; using System.Collections.Generic; using System.Threading; @@ -54,17 +55,28 @@ namespace MediaBrowser.Controller.LiveTv /// Gets the channels. /// /// The query. + /// The cancellation token. /// IEnumerable{Channel}. - QueryResult GetChannels(ChannelQuery query); + Task> GetChannels(ChannelQuery query, CancellationToken cancellationToken); /// /// Gets the recording. /// /// The identifier. + /// The user. /// The cancellation token. /// Task{RecordingInfoDto}. - Task GetRecording(string id, CancellationToken cancellationToken); + Task GetRecording(string id, CancellationToken cancellationToken, User user = null); + /// + /// Gets the channel. + /// + /// The identifier. + /// The cancellation token. + /// The user. + /// Task{RecordingInfoDto}. + Task GetChannel(string id, CancellationToken cancellationToken, User user = null); + /// /// Gets the timer. /// @@ -73,6 +85,14 @@ namespace MediaBrowser.Controller.LiveTv /// Task{TimerInfoDto}. Task GetTimer(string id, CancellationToken cancellationToken); + /// + /// Gets the series timer. + /// + /// The identifier. + /// The cancellation token. + /// Task{TimerInfoDto}. + Task GetSeriesTimer(string id, CancellationToken cancellationToken); + /// /// Gets the recordings. /// @@ -90,19 +110,19 @@ namespace MediaBrowser.Controller.LiveTv Task> GetTimers(TimerQuery query, CancellationToken cancellationToken); /// - /// Gets the channel. + /// Gets the series timers. /// - /// The identifier. - /// Channel. - Channel GetChannel(string id); - + /// The query. + /// The cancellation token. + /// Task{QueryResult{SeriesTimerInfoDto}}. + Task> GetSeriesTimers(SeriesTimerQuery query, CancellationToken cancellationToken); + /// /// Gets the channel. /// /// The identifier. - /// The user identifier. /// Channel. - ChannelInfoDto GetChannelInfoDto(string id, string userId); + Channel GetChannel(string id); /// /// Gets the programs. @@ -111,5 +131,21 @@ namespace MediaBrowser.Controller.LiveTv /// The cancellation token. /// IEnumerable{ProgramInfo}. Task> GetPrograms(ProgramQuery query, CancellationToken cancellationToken); + + /// + /// Updates the timer. + /// + /// The timer. + /// The cancellation token. + /// Task. + Task UpdateTimer(TimerInfoDto timer, CancellationToken cancellationToken); + + /// + /// Updates the timer. + /// + /// The timer. + /// The cancellation token. + /// Task. + Task UpdateSeriesTimer(SeriesTimerInfoDto timer, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs index de75ee752..8b1801f9e 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Common.Net; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -55,6 +54,14 @@ namespace MediaBrowser.Controller.LiveTv /// Task. Task CreateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken); + /// + /// Updates the timer asynchronous. + /// + /// The information. + /// The cancellation token. + /// Task. + Task UpdateTimerAsync(TimerInfo info, CancellationToken cancellationToken); + /// /// Updates the series timer asynchronous. /// diff --git a/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs b/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs index 6b6123e54..d454a1ef8 100644 --- a/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs +++ b/MediaBrowser.Controller/LiveTv/ImageResponseInfo.cs @@ -15,11 +15,5 @@ namespace MediaBrowser.Controller.LiveTv /// /// The type of the MIME. public string MimeType { get; set; } - - /// - /// Gets or sets the image path. - /// - /// The image path. - public string ImagePath { get; set; } } } diff --git a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs index 44594882c..607282796 100644 --- a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs +++ b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs @@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.LiveTv /// ChannelId of the recording. /// public string ChannelId { get; set; } - + /// /// ChannelName of the recording. /// @@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// The program identifier. public string ProgramId { get; set; } - + /// /// Name of the recording. /// @@ -35,7 +35,7 @@ namespace MediaBrowser.Controller.LiveTv /// /// Description of the recording. /// - public string Description { get; set; } + public string Overview { get; set; } /// /// The start date of the recording, in UTC. @@ -47,18 +47,6 @@ namespace MediaBrowser.Controller.LiveTv /// public DateTime EndDate { get; set; } - /// - /// Gets or sets the pre padding seconds. - /// - /// The pre padding seconds. - public int PrePaddingSeconds { get; set; } - - /// - /// Gets or sets the post padding seconds. - /// - /// The post padding seconds. - public int PostPaddingSeconds { get; set; } - /// /// Gets or sets the type of the recurrence. /// @@ -77,6 +65,30 @@ namespace MediaBrowser.Controller.LiveTv /// The priority. public int Priority { get; set; } + /// + /// Gets or sets the requested pre padding seconds. + /// + /// The requested pre padding seconds. + public int RequestedPrePaddingSeconds { get; set; } + + /// + /// Gets or sets the requested post padding seconds. + /// + /// The requested post padding seconds. + public int RequestedPostPaddingSeconds { get; set; } + + /// + /// Gets or sets the required pre padding seconds. + /// + /// The required pre padding seconds. + public int RequiredPrePaddingSeconds { get; set; } + + /// + /// Gets or sets the required post padding seconds. + /// + /// The required post padding seconds. + public int RequiredPostPaddingSeconds { get; set; } + public SeriesTimerInfo() { Days = new List(); diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 9c35a4e99..c9f57a927 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -759,11 +759,30 @@ namespace MediaBrowser.Controller.Providers break; } - case "MediaInfo": + case "Format3D": { - using (var subtree = reader.ReadSubtree()) + var video = item as Video; + + if (video != null) { - FetchFromMediaInfoNode(subtree, item); + var val = reader.ReadElementContentAsString(); + + if (string.Equals("HSBS", val)) + { + video.Video3DFormat = Video3DFormat.HalfSideBySide; + } + else if (string.Equals("HTAB", val)) + { + video.Video3DFormat = Video3DFormat.HalfTopAndBottom; + } + else if (string.Equals("FTAB", val)) + { + video.Video3DFormat = Video3DFormat.FullTopAndBottom; + } + else if (string.Equals("FSBS", val)) + { + video.Video3DFormat = Video3DFormat.FullSideBySide; + } } break; } @@ -774,89 +793,6 @@ namespace MediaBrowser.Controller.Providers } } - /// - /// Fetches from media info node. - /// - /// The reader. - /// The item. - private void FetchFromMediaInfoNode(XmlReader reader, T item) - { - reader.MoveToContent(); - - while (reader.Read()) - { - if (reader.NodeType == XmlNodeType.Element) - { - switch (reader.Name) - { - case "Video": - { - using (var subtree = reader.ReadSubtree()) - { - FetchFromMediaInfoVideoNode(subtree, item); - } - break; - } - - default: - reader.Skip(); - break; - } - } - } - } - - /// - /// Fetches from media info video node. - /// - /// The reader. - /// The item. - private void FetchFromMediaInfoVideoNode(XmlReader reader, T item) - { - reader.MoveToContent(); - - while (reader.Read()) - { - if (reader.NodeType == XmlNodeType.Element) - { - switch (reader.Name) - { - case "Format3D": - { - var video = item as Video; - - if (video != null) - { - var val = reader.ReadElementContentAsString(); - - if (string.Equals("HSBS", val)) - { - video.Video3DFormat = Video3DFormat.HalfSideBySide; - } - else if (string.Equals("HTAB", val)) - { - video.Video3DFormat = Video3DFormat.HalfTopAndBottom; - } - else if (string.Equals("FTAB", val)) - { - video.Video3DFormat = Video3DFormat.FullTopAndBottom; - } - else if (string.Equals("FSBS", val)) - { - video.Video3DFormat = Video3DFormat.FullSideBySide; - } - } - break; - } - - default: - reader.Skip(); - break; - } - } - } - } - /// /// Fetches from taglines node. /// -- cgit v1.2.3