浏览代码

added live tv items page

Luke Pulverenti 10 年之前
父节点
当前提交
cde1df51ec

+ 7 - 1
MediaBrowser.Model/LiveTv/ProgramInfoDto.cs

@@ -95,7 +95,13 @@ namespace MediaBrowser.Model.LiveTv
         /// </summary>
         /// <value>The official rating.</value>
         public string OfficialRating { get; set; }
-        
+
+        /// <summary>
+        /// Gets or sets the production year.
+        /// </summary>
+        /// <value>The production year.</value>
+        public int? ProductionYear { get; set; }
+
         /// <summary>
         /// Gets or sets the name of the service.
         /// </summary>

+ 2 - 1
MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs

@@ -387,7 +387,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
                 IsPremiere = item.IsPremiere,
                 Type = "Program",
                 MediaType = item.MediaType,
-                ServerId = _appHost.SystemId
+                ServerId = _appHost.SystemId,
+                ProductionYear = item.ProductionYear
             };
 
             if (item.EndDate.HasValue)

+ 7 - 6
MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs

@@ -685,19 +685,20 @@ namespace MediaBrowser.Server.Implementations.LiveTv
             programs = _libraryManager.Sort(programs, user, query.SortBy, query.SortOrder ?? SortOrder.Ascending)
                 .Cast<LiveTvProgram>();
 
+            var programList = programs.ToList();
+            IEnumerable<LiveTvProgram> returnPrograms = programList;
+
             if (query.StartIndex.HasValue)
             {
-                programs = programs.Skip(query.StartIndex.Value);
+                returnPrograms = returnPrograms.Skip(query.StartIndex.Value);
             }
 
             if (query.Limit.HasValue)
             {
-                programs = programs.Take(query.Limit.Value);
+                returnPrograms = returnPrograms.Take(query.Limit.Value);
             }
 
-            var programList = programs.ToList();
-
-            var returnArray = programList
+            var returnArray = returnPrograms
                 .Select(i =>
                 {
                     var channel = GetChannel(i);
@@ -713,7 +714,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
             var result = new QueryResult<ProgramInfoDto>
             {
                 Items = returnArray,
-                TotalRecordCount = returnArray.Length
+                TotalRecordCount = programList.Count
             };
 
             return result;

+ 4 - 1
MediaBrowser.Server.Implementations/Localization/Server/server.json

@@ -1391,5 +1391,8 @@
     "HeaderThisUserIsCurrentlyDisabled": "This user is currently disabled",
     "MessageReenableUser": "See below to reenable",
     "LabelEnableInternetMetadataForTvPrograms": "Download internet metadata for:",
-    "OptionTVMovies": "TV Movies"
+    "OptionTVMovies": "TV Movies",
+    "HeaderUpcomingMovies": "Upcoming Movies",
+    "HeaderUpcomingPrograms":  "Upcoming Programs",
+    "ButtonMoreItems": "More..."
 }

+ 1 - 0
MediaBrowser.WebDashboard/Api/PackageCreator.cs

@@ -429,6 +429,7 @@ namespace MediaBrowser.WebDashboard.Api
                                 "livetvchannel.js",
                                 "livetvchannels.js",
                                 "livetvguide.js",
+                                "livetvitems.js",
                                 "livetvnewrecording.js",
                                 "livetvprogram.js",
                                 "livetvrecording.js",

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

@@ -120,6 +120,9 @@
     <Content Include="dashboard-ui\kids.html">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="dashboard-ui\livetvitems.html">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="dashboard-ui\mysync.html">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
@@ -138,6 +141,9 @@
     <Content Include="dashboard-ui\scripts\kids.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="dashboard-ui\scripts\livetvitems.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="dashboard-ui\scripts\selectserver.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>