Techywarrior 12 years ago
commit 4cdfff0b7e

@ -198,6 +198,8 @@ namespace MediaBrowser.Api.UserLibrary
items = items.AsParallel(); items = items.AsParallel();
items = ApplyAdditionalFilters(request, items);
// Apply filters // Apply filters
// Run them starting with the ones that are likely to reduce the list the most // 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)) foreach (var filter in GetFilters(request).OrderByDescending(f => (int)f))
@ -205,8 +207,6 @@ namespace MediaBrowser.Api.UserLibrary
items = ApplyFilter(items, filter, user); items = ApplyFilter(items, filter, user);
} }
items = ApplyAdditionalFilters(request, items);
items = items.AsEnumerable(); items = items.AsEnumerable();
items = ApplySearchTerm(request, items); items = ApplySearchTerm(request, items);

@ -176,7 +176,7 @@ namespace MediaBrowser.Controller.MediaInfo
if (extractImages) if (extractImages)
{ {
// Disable for now on folder rips // Disable for now on folder rips
if (video.VideoType != VideoType.VideoFile) if (video.VideoType != VideoType.VideoFile && video.VideoType != VideoType.Dvd)
{ {
continue; continue;
} }

@ -51,6 +51,21 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
return _locks.GetOrAdd(filename, key => new SemaphoreSlim(1, 1)); return _locks.GetOrAdd(filename, key => new SemaphoreSlim(1, 1));
} }
/// <summary>
/// Needses the refresh internal.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="providerInfo">The provider info.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
{
if (!string.IsNullOrEmpty(item.PrimaryImagePath))
{
return false;
}
return base.NeedsRefreshInternal(item, providerInfo);
}
/// <summary> /// <summary>
/// Fetches metadata and returns true or false indicating if any work that requires persistence was done /// Fetches metadata and returns true or false indicating if any work that requires persistence was done
/// </summary> /// </summary>

@ -70,6 +70,21 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
return false; return false;
} }
/// <summary>
/// Needses the refresh internal.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="providerInfo">The provider info.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
{
if (!string.IsNullOrEmpty(item.PrimaryImagePath))
{
return false;
}
return base.NeedsRefreshInternal(item, providerInfo);
}
/// <summary> /// <summary>
/// The true task result /// The true task result
/// </summary> /// </summary>

@ -698,13 +698,14 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
{ {
var resourcePool = type == InputType.AudioFile ? _audioImageResourcePool : _videoImageResourcePool; 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);
} }
/// <summary> /// <summary>
/// Extracts the image. /// Extracts the image.
/// </summary> /// </summary>
/// <param name="inputPath">The input path.</param> /// <param name="inputPath">The input path.</param>
/// <param name="type">The type.</param>
/// <param name="offset">The offset.</param> /// <param name="offset">The offset.</param>
/// <param name="outputPath">The output path.</param> /// <param name="outputPath">The output path.</param>
/// <param name="resourcePool">The resource pool.</param> /// <param name="resourcePool">The resource pool.</param>
@ -714,7 +715,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
/// or /// or
/// outputPath</exception> /// outputPath</exception>
/// <exception cref="System.ApplicationException"></exception> /// <exception cref="System.ApplicationException"></exception>
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)) 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) if (offset.HasValue)
{ {

@ -288,7 +288,7 @@ namespace MediaBrowser.Server.Implementations.Updates
return latestPluginInfo != null && latestPluginInfo.version > p.Version ? latestPluginInfo : null; 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)); .Where(p => p != null && !string.IsNullOrWhiteSpace(p.sourceUrl));
} }

Loading…
Cancel
Save