From a72a297c88a50e48c1dc4a6b58c7213be786e1a0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 3 Mar 2014 23:53:48 -0500 Subject: [PATCH] add more report data --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 39 ++++++++++++++++++- .../Entities/TV/Episode.cs | 2 +- .../Providers/BaseItemXmlParser.cs | 1 - .../ScheduledTasks/PeopleValidationTask.cs | 4 +- .../ScheduledTasks/RefreshMediaLibraryTask.cs | 2 +- .../FFMpeg/FFMpegDownloadInfo.cs | 4 +- .../Api/DashboardService.cs | 3 +- .../MediaBrowser.WebDashboard.csproj | 4 +- 8 files changed, 47 insertions(+), 12 deletions(-) diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 4a5b69704b..871c9aecb4 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -224,8 +224,14 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "IsLocked", Description = "Optional filter by items that are locked.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public bool? IsLocked { get; set; } - [ApiMember(Name = "HasSubtitles", Description = "Optional filter by items that are unidentified by internet metadata providers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + [ApiMember(Name = "IsUnidentified", Description = "Optional filter by items that are unidentified by internet metadata providers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public bool? IsUnidentified { get; set; } + + [ApiMember(Name = "IsPlaceHolder", Description = "Optional filter by items that are placeholders", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public bool? IsPlaceHolder { get; set; } + + [ApiMember(Name = "HasOfficialRating", Description = "Optional filter by items that have official ratings", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] + public bool? HasOfficialRating { get; set; } } /// @@ -1135,6 +1141,37 @@ namespace MediaBrowser.Api.UserLibrary items = items.Where(i => IsYearMismatched(i) == filterValue); } + if (request.HasOfficialRating.HasValue) + { + var filterValue = request.HasOfficialRating.Value; + + items = items.Where(i => + { + var hasValue = !string.IsNullOrEmpty(i.OfficialRating); + + return hasValue == filterValue; + }); + } + + if (request.IsPlaceHolder.HasValue) + { + var filterValue = request.IsPlaceHolder.Value; + + items = items.Where(i => + { + var isPlaceHolder = false; + + var hasPlaceHolder = i as ISupportsPlaceHolders; + + if (hasPlaceHolder != null) + { + isPlaceHolder = hasPlaceHolder.IsPlaceHolder; + } + + return isPlaceHolder == filterValue; + }); + } + return items; } diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index 4a3c82b461..503d1513c1 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -185,7 +185,7 @@ namespace MediaBrowser.Controller.Entities.TV { get { - return LocationType == LocationType.Virtual && PremiereDate.HasValue && PremiereDate.Value < DateTime.UtcNow; + return LocationType == LocationType.Virtual && !IsUnaired; } } diff --git a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs index 0163dec206..d71c7af323 100644 --- a/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Providers/BaseItemXmlParser.cs @@ -779,7 +779,6 @@ namespace MediaBrowser.Controller.Providers break; case "TMDbCollectionId": - case "CollectionNumber": var tmdbCollection = reader.ReadElementContentAsString(); if (!string.IsNullOrWhiteSpace(tmdbCollection)) { diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs index 7d0593c5f1..bfa4fe9446 100644 --- a/MediaBrowser.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs +++ b/MediaBrowser.Server.Implementations/ScheduledTasks/PeopleValidationTask.cs @@ -34,9 +34,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks { return new ITaskTrigger[] { - new DailyTrigger { TimeOfDay = TimeSpan.FromHours(2) }, - - new IntervalTrigger{ Interval = TimeSpan.FromHours(24)} + new DailyTrigger { TimeOfDay = TimeSpan.FromHours(3) }, }; } diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs index 462dc1e785..97dfb2c5dd 100644 --- a/MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs +++ b/MediaBrowser.Server.Implementations/ScheduledTasks/RefreshMediaLibraryTask.cs @@ -40,7 +40,7 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks new SystemEventTrigger{ SystemEvent = SystemEvent.WakeFromSleep}, - new IntervalTrigger{ Interval = TimeSpan.FromHours(4)} + new IntervalTrigger{ Interval = TimeSpan.FromHours(6)} }; } diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs index c560a5b919..2588c3d5cf 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs @@ -121,7 +121,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg { return new[] { - "https://copy.com/IB0W4efS6t9A/ffall-2.1.1.tar.gz?download=1" + "https://www.dropbox.com/s/n188rxbulqem8ry/ffmpeg-osx-20131121.gz?dl=1" }; } @@ -148,7 +148,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg //No Unix version available return new string[] {}; - #endif +#endif } return new string[] {}; } diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 0e6010fd0c..c10b17d678 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -456,8 +456,6 @@ namespace MediaBrowser.WebDashboard.Api /// Task{Stream}. private async Task GetAllJavascript() { - var assembly = GetType().Assembly; - var scriptFiles = new[] { "extensions.js", @@ -581,6 +579,7 @@ namespace MediaBrowser.WebDashboard.Api await AppendResource(memoryStream, "thirdparty/autonumeric/autoNumeric.min.js", newLineBytes).ConfigureAwait(false); + var assembly = GetType().Assembly; await AppendResource(assembly, memoryStream, "MediaBrowser.WebDashboard.ApiClient.js", newLineBytes).ConfigureAwait(false); foreach (var file in scriptFiles) diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 55f97e1dae..4895d203f5 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -84,7 +84,9 @@ - + + PreserveNewest + PreserveNewest