Browse Source

live tv updates

Luke Pulverenti 11 years ago
parent
commit
594ed864c6

+ 5 - 1
MediaBrowser.Api/LiveTv/LiveTvImageService.cs

@@ -178,7 +178,11 @@ namespace MediaBrowser.Api.LiveTv
         private ImageService GetImageService()
         {
             return new ImageService(_userManager, _libraryManager, _appPaths, _providerManager, _itemRepo, _dtoService,
-                _imageProcessor);
+                _imageProcessor)
+            {
+                ResultFactory = ResultFactory,
+                Request = Request
+            };
         }
     }
 }

+ 24 - 0
MediaBrowser.Controller/LiveTv/ProgramInfo.cs

@@ -133,6 +133,30 @@ namespace MediaBrowser.Controller.LiveTv
         /// <value><c>true</c> if this instance is video; otherwise, <c>false</c>.</value>
         public bool IsVideo { get; set; }
 
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is live.
+        /// </summary>
+        /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
+        public bool IsLive { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is news.
+        /// </summary>
+        /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
+        public bool IsNews { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is kids.
+        /// </summary>
+        /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
+        public bool IsKids { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is premiere.
+        /// </summary>
+        /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
+        public bool IsPremiere { get; set;  }
+
         public ProgramInfo()
         {
             Genres = new List<string>();

+ 42 - 0
MediaBrowser.Controller/LiveTv/RecordingInfo.cs

@@ -101,6 +101,48 @@ namespace MediaBrowser.Controller.LiveTv
         /// <value>The audio.</value>
         public ProgramAudio? Audio { get; set; }
 
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is movie.
+        /// </summary>
+        /// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
+        public bool IsMovie { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is sports.
+        /// </summary>
+        /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
+        public bool IsSports { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is series.
+        /// </summary>
+        /// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
+        public bool IsSeries { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is live.
+        /// </summary>
+        /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
+        public bool IsLive { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is news.
+        /// </summary>
+        /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
+        public bool IsNews { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is kids.
+        /// </summary>
+        /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
+        public bool IsKids { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is premiere.
+        /// </summary>
+        /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
+        public bool IsPremiere { get; set; }
+
         /// <summary>
         /// Gets or sets the official rating.
         /// </summary>

+ 30 - 0
MediaBrowser.Model/LiveTv/ProgramInfoDto.cs

@@ -139,12 +139,42 @@ namespace MediaBrowser.Model.LiveTv
         /// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
         public bool IsSeries { get; set; }
 
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is live.
+        /// </summary>
+        /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
+        public bool IsLive { get; set; }
+
         /// <summary>
         /// Gets or sets the type.
         /// </summary>
         /// <value>The type.</value>
         public string Type { get; set; }
 
+        /// <summary>
+        /// Gets or sets the run time ticks.
+        /// </summary>
+        /// <value>The run time ticks.</value>
+        public long? RunTimeTicks { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is news.
+        /// </summary>
+        /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
+        public bool IsNews { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is kids.
+        /// </summary>
+        /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
+        public bool IsKids { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is premiere.
+        /// </summary>
+        /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
+        public bool IsPremiere { get; set; }
+
         public ProgramInfoDto()
         {
             Genres = new List<string>();

+ 45 - 3
MediaBrowser.Model/LiveTv/RecordingInfoDto.cs

@@ -96,10 +96,10 @@ namespace MediaBrowser.Model.LiveTv
         public string EpisodeTitle { get; set; }
 
         /// <summary>
-        /// Gets or sets the duration ms.
+        /// Gets or sets the run time ticks.
         /// </summary>
-        /// <value>The duration ms.</value>
-        public int DurationMs { get; set; }
+        /// <value>The run time ticks.</value>
+        public long? RunTimeTicks { get; set; }
 
         /// <summary>
         /// Gets or sets the type of the media.
@@ -137,6 +137,48 @@ namespace MediaBrowser.Model.LiveTv
         /// <value>The audio.</value>
         public ProgramAudio? Audio { get; set; }
 
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is movie.
+        /// </summary>
+        /// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
+        public bool IsMovie { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is sports.
+        /// </summary>
+        /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
+        public bool IsSports { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is series.
+        /// </summary>
+        /// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
+        public bool IsSeries { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is live.
+        /// </summary>
+        /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
+        public bool IsLive { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is news.
+        /// </summary>
+        /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
+        public bool IsNews { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is kids.
+        /// </summary>
+        /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
+        public bool IsKids { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is premiere.
+        /// </summary>
+        /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
+        public bool IsPremiere { get; set; }
+
         /// <summary>
         /// Gets or sets the image tags.
         /// </summary>

+ 3 - 3
MediaBrowser.Model/LiveTv/TimerInfoDto.cs

@@ -112,10 +112,10 @@ namespace MediaBrowser.Model.LiveTv
         public bool IsPostPaddingRequired { get; set; }
 
         /// <summary>
-        /// Gets or sets the duration ms.
+        /// Gets or sets the run time ticks.
         /// </summary>
-        /// <value>The duration ms.</value>
-        public int DurationMs { get; set; }
+        /// <value>The run time ticks.</value>
+        public long? RunTimeTicks { get; set; }
 
         /// <summary>
         /// Gets or sets the priority.

+ 17 - 9
MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs

@@ -52,12 +52,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv
                 ExternalSeriesTimerId = info.SeriesTimerId,
                 ServiceName = service.Name,
                 ExternalProgramId = info.ProgramId,
-                Priority = info.Priority
+                Priority = info.Priority,
+                RunTimeTicks = (info.EndDate - info.StartDate).Ticks
             };
 
-            var duration = info.EndDate - info.StartDate;
-            dto.DurationMs = Convert.ToInt32(duration.TotalMilliseconds);
-
             if (!string.IsNullOrEmpty(info.ProgramId))
             {
                 dto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
@@ -177,7 +175,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv
                 Audio = info.Audio,
                 IsHD = info.IsHD,
                 ServiceName = service.Name,
-                Url = info.Url
+                Url = info.Url,
+                IsMovie = info.IsMovie,
+                IsSeries = info.IsSeries,
+                IsSports = info.IsSports,
+                IsLive = info.IsLive,
+                IsNews = info.IsNews,
+                IsKids = info.IsKids,
+                IsPremiere = info.IsPremiere,
+                RunTimeTicks = (info.EndDate - info.StartDate).Ticks
             };
 
             var imageTag = GetImageTag(recording);
@@ -192,9 +198,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
                 dto.UserData = _dtoService.GetUserItemDataDto(_userDataManager.GetUserData(user.Id, recording.GetUserDataKey()));
             }
 
-            var duration = info.EndDate - info.StartDate;
-            dto.DurationMs = Convert.ToInt32(duration.TotalMilliseconds);
-
             if (!string.IsNullOrEmpty(info.ProgramId))
             {
                 dto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");
@@ -264,7 +267,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
                 ChannelName = program.ChannelName,
                 IsMovie = program.IsMovie,
                 IsSeries = program.IsSeries,
-                IsSports = program.IsSports
+                IsSports = program.IsSports,
+                IsLive = program.IsLive,
+                IsNews = program.IsNews,
+                IsKids = program.IsKids,
+                IsPremiere = program.IsPremiere,
+                RunTimeTicks = (program.EndDate - program.StartDate).Ticks
             };
 
             if (user != null)

+ 3 - 1
MediaBrowser.WebDashboard/Api/DashboardService.cs

@@ -496,6 +496,7 @@ namespace MediaBrowser.WebDashboard.Api
                                       "livetvchannels.js",
                                       "livetvguide.js",
                                       "livetvnewrecording.js",
+                                      "livetvprogram.js",
                                       "livetvrecording.js",
                                       "livetvrecordings.js",
                                       "livetvtimer.js",
@@ -595,7 +596,8 @@ namespace MediaBrowser.WebDashboard.Api
                                       "search.css",
                                       "pluginupdates.css",
                                       "remotecontrol.css",
-                                      "userimage.css"
+                                      "userimage.css",
+                                      "livetv.css"
                                   };
 
             var memoryStream = new MemoryStream();

+ 9 - 0
MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj

@@ -91,12 +91,18 @@
     <Content Include="dashboard-ui\css\images\items\detail\tv.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="dashboard-ui\css\livetv.css">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="dashboard-ui\livetvchannel.html">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     <Content Include="dashboard-ui\livetvnewrecording.html">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="dashboard-ui\livetvprogram.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="dashboard-ui\livetvrecording.html">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
@@ -370,6 +376,9 @@
     <Content Include="dashboard-ui\scripts\livetvnewrecording.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="dashboard-ui\scripts\livetvprogram.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="dashboard-ui\scripts\livetvrecording.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>

+ 2 - 2
Nuget/MediaBrowser.Common.Internal.nuspec

@@ -2,7 +2,7 @@
 <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
     <metadata>
         <id>MediaBrowser.Common.Internal</id>
-        <version>3.0.281</version>
+        <version>3.0.284</version>
         <title>MediaBrowser.Common.Internal</title>
         <authors>Luke</authors>
         <owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
         <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
         <copyright>Copyright © Media Browser 2013</copyright>
         <dependencies>
-            <dependency id="MediaBrowser.Common" version="3.0.281" />
+            <dependency id="MediaBrowser.Common" version="3.0.284" />
             <dependency id="NLog" version="2.1.0" />
             <dependency id="SimpleInjector" version="2.4.0" />
             <dependency id="sharpcompress" version="0.10.2" />

+ 1 - 1
Nuget/MediaBrowser.Common.nuspec

@@ -2,7 +2,7 @@
 <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
     <metadata>
         <id>MediaBrowser.Common</id>
-        <version>3.0.281</version>
+        <version>3.0.284</version>
         <title>MediaBrowser.Common</title>
         <authors>Media Browser Team</authors>
         <owners>ebr,Luke,scottisafool</owners>

+ 2 - 2
Nuget/MediaBrowser.Server.Core.nuspec

@@ -2,7 +2,7 @@
 <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
     <metadata>
         <id>MediaBrowser.Server.Core</id>
-        <version>3.0.281</version>
+        <version>3.0.284</version>
         <title>Media Browser.Server.Core</title>
         <authors>Media Browser Team</authors>
         <owners>ebr,Luke,scottisafool</owners>
@@ -12,7 +12,7 @@
         <description>Contains core components required to build plugins for Media Browser Server.</description>
         <copyright>Copyright © Media Browser 2013</copyright>
         <dependencies>
-            <dependency id="MediaBrowser.Common" version="3.0.281" />
+            <dependency id="MediaBrowser.Common" version="3.0.284" />
         </dependencies>
     </metadata>
     <files>