From dbf9ac1233d1edf75325f6d09561d899c21ad663 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Apr 2013 01:06:13 -0400 Subject: [PATCH 1/3] paging progress --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 4 ++-- .../Updates/InstallationManager.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 62b7d5fc9..4561d823b 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -198,6 +198,8 @@ namespace MediaBrowser.Api.UserLibrary items = items.AsParallel(); + items = ApplyAdditionalFilters(request, items); + // Apply filters // Run them starting with the ones that are likely to reduce the list the most foreach (var filter in GetFilters(request).OrderByDescending(f => (int)f)) @@ -205,8 +207,6 @@ namespace MediaBrowser.Api.UserLibrary items = ApplyFilter(items, filter, user); } - items = ApplyAdditionalFilters(request, items); - items = items.AsEnumerable(); items = ApplySearchTerm(request, items); diff --git a/MediaBrowser.Server.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Server.Implementations/Updates/InstallationManager.cs index 271d3d877..347e378fe 100644 --- a/MediaBrowser.Server.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Server.Implementations/Updates/InstallationManager.cs @@ -288,7 +288,7 @@ namespace MediaBrowser.Server.Implementations.Updates return latestPluginInfo != null && latestPluginInfo.version > p.Version ? latestPluginInfo : null; - }).Where(p => !CompletedInstallations.Any(i => i.Name.Equals(p.name, StringComparison.OrdinalIgnoreCase))) + }).Where(p => !CompletedInstallations.Any(i => string.Equals(i.Name, p.name, StringComparison.OrdinalIgnoreCase))) .Where(p => p != null && !string.IsNullOrWhiteSpace(p.sourceUrl)); } From 29818f8cbf1df2e5d2f67eff29b5b2e6568e4a37 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Apr 2013 08:31:18 -0400 Subject: [PATCH 2/3] fixes Dvd Chapter Thumbs (#126) --- MediaBrowser.Controller/MediaInfo/FFMpegManager.cs | 2 +- .../MediaEncoder/MediaEncoder.cs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs index eb8f600f5..27713bbe6 100644 --- a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs +++ b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs @@ -176,7 +176,7 @@ namespace MediaBrowser.Controller.MediaInfo if (extractImages) { // Disable for now on folder rips - if (video.VideoType != VideoType.VideoFile) + if (video.VideoType != VideoType.VideoFile && video.VideoType != VideoType.Dvd) { continue; } diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs index fce88e3d8..ab039f9d2 100644 --- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs +++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs @@ -698,13 +698,14 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder { var resourcePool = type == InputType.AudioFile ? _audioImageResourcePool : _videoImageResourcePool; - return ExtractImageInternal(GetInputArgument(inputFiles, type), offset, outputPath, resourcePool, cancellationToken); + return ExtractImageInternal(GetInputArgument(inputFiles, type), type, offset, outputPath, resourcePool, cancellationToken); } /// /// Extracts the image. /// /// The input path. + /// The type. /// The offset. /// The output path. /// The resource pool. @@ -714,7 +715,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder /// or /// outputPath /// - private async Task ExtractImageInternal(string inputPath, TimeSpan? offset, string outputPath, SemaphoreSlim resourcePool, CancellationToken cancellationToken) + private async Task ExtractImageInternal(string inputPath, InputType type, TimeSpan? offset, string outputPath, SemaphoreSlim resourcePool, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(inputPath)) { @@ -727,7 +728,8 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder } - var args = string.Format("-i {0} -threads 0 -v quiet -vframes 1 -filter:v select=\\'eq(pict_type\\,I)\\' -f image2 \"{1}\"", inputPath, outputPath); + var args = type != InputType.Dvd ? string.Format("-i {0} -threads 0 -v quiet -vframes 1 -filter:v select=\\'eq(pict_type\\,I)\\' -f image2 \"{1}\"", inputPath, outputPath) : + string.Format("-i {0} -threads 0 -v quiet -vframes 1 -f image2 \"{1}\"", inputPath, outputPath); if (offset.HasValue) { From 43d9cea6c4da874cd85335c2c325d7863933a362 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 9 Apr 2013 08:50:51 -0400 Subject: [PATCH 3/3] Media Thumbs (not chapters) (#127) --- .../MediaInfo/FFMpegAudioImageProvider.cs | 15 +++++++++++++++ .../MediaInfo/FFMpegVideoImageProvider.cs | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/MediaBrowser.Controller/Providers/MediaInfo/FFMpegAudioImageProvider.cs b/MediaBrowser.Controller/Providers/MediaInfo/FFMpegAudioImageProvider.cs index 421b0522d..e1cbc6932 100644 --- a/MediaBrowser.Controller/Providers/MediaInfo/FFMpegAudioImageProvider.cs +++ b/MediaBrowser.Controller/Providers/MediaInfo/FFMpegAudioImageProvider.cs @@ -51,6 +51,21 @@ namespace MediaBrowser.Controller.Providers.MediaInfo return _locks.GetOrAdd(filename, key => new SemaphoreSlim(1, 1)); } + /// + /// Needses the refresh internal. + /// + /// The item. + /// The provider info. + /// true if XXXX, false otherwise + protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo) + { + if (!string.IsNullOrEmpty(item.PrimaryImagePath)) + { + return false; + } + return base.NeedsRefreshInternal(item, providerInfo); + } + /// /// Fetches metadata and returns true or false indicating if any work that requires persistence was done /// diff --git a/MediaBrowser.Controller/Providers/MediaInfo/FFMpegVideoImageProvider.cs b/MediaBrowser.Controller/Providers/MediaInfo/FFMpegVideoImageProvider.cs index a29dbb043..ad81fa442 100644 --- a/MediaBrowser.Controller/Providers/MediaInfo/FFMpegVideoImageProvider.cs +++ b/MediaBrowser.Controller/Providers/MediaInfo/FFMpegVideoImageProvider.cs @@ -70,6 +70,21 @@ namespace MediaBrowser.Controller.Providers.MediaInfo return false; } + /// + /// Needses the refresh internal. + /// + /// The item. + /// The provider info. + /// true if XXXX, false otherwise + protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo) + { + if (!string.IsNullOrEmpty(item.PrimaryImagePath)) + { + return false; + } + return base.NeedsRefreshInternal(item, providerInfo); + } + /// /// The true task result ///