From cde1df51ec093b1d35fd5fa5e89c528ff079a887 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 14 Mar 2015 16:56:50 -0400 Subject: [PATCH] added live tv items page --- MediaBrowser.Model/LiveTv/ProgramInfoDto.cs | 8 +++++++- .../LiveTv/LiveTvDtoService.cs | 3 ++- .../LiveTv/LiveTvManager.cs | 13 +++++++------ .../Localization/Server/server.json | 5 ++++- MediaBrowser.WebDashboard/Api/PackageCreator.cs | 1 + .../MediaBrowser.WebDashboard.csproj | 6 ++++++ 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs index f511a7a17..06136459f 100644 --- a/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/ProgramInfoDto.cs @@ -95,7 +95,13 @@ namespace MediaBrowser.Model.LiveTv /// /// The official rating. public string OfficialRating { get; set; } - + + /// + /// Gets or sets the production year. + /// + /// The production year. + public int? ProductionYear { get; set; } + /// /// Gets or sets the name of the service. /// diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs index 6473d10d6..7f4440fbc 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/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) diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index acff25e96..6b66ed9b8 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/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(); + var programList = programs.ToList(); + IEnumerable 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 { Items = returnArray, - TotalRecordCount = returnArray.Length + TotalRecordCount = programList.Count }; return result; diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index e5b1e5a8b..24bccaf1d 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/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..." } diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 2807b631c..ac94f680b 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/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", diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index c02eb5848..d7c354da3 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -120,6 +120,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -138,6 +141,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest