Merge pull request #1091 from MediaBrowser/dev

3.0.5597.1
pull/702/head
Luke 10 years ago
commit 36b2c5fa15

@ -57,7 +57,8 @@ namespace Emby.Drawing
IServerApplicationPaths appPaths, IServerApplicationPaths appPaths,
IFileSystem fileSystem, IFileSystem fileSystem,
IJsonSerializer jsonSerializer, IJsonSerializer jsonSerializer,
IImageEncoder imageEncoder) IImageEncoder imageEncoder,
int maxConcurrentImageProcesses)
{ {
_logger = logger; _logger = logger;
_fileSystem = fileSystem; _fileSystem = fileSystem;
@ -93,8 +94,8 @@ namespace Emby.Drawing
} }
_cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary); _cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary);
var count = Environment.ProcessorCount; _logger.Info("ImageProcessor started with {0} max concurrent image processes", maxConcurrentImageProcesses);
_imageProcessingSemaphore = new SemaphoreSlim(count, count); _imageProcessingSemaphore = new SemaphoreSlim(maxConcurrentImageProcesses, maxConcurrentImageProcesses);
} }
public string[] SupportedInputFormats public string[] SupportedInputFormats

@ -100,7 +100,19 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected override string CreateUserDataKey() protected override string CreateUserDataKey()
{ {
return this.GetProviderId(MetadataProviders.Tmdb) ?? this.GetProviderId(MetadataProviders.Imdb) ?? base.CreateUserDataKey(); var key = this.GetProviderId(MetadataProviders.Tmdb);
if (string.IsNullOrWhiteSpace(key))
{
key = this.GetProviderId(MetadataProviders.Imdb);
}
if (string.IsNullOrWhiteSpace(key))
{
key = base.CreateUserDataKey();
}
return key;
} }
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken) protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemInfo> fileSystemChildren, CancellationToken cancellationToken)

@ -113,7 +113,19 @@ namespace MediaBrowser.Controller.Entities.TV
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected override string CreateUserDataKey() protected override string CreateUserDataKey()
{ {
return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.CreateUserDataKey(); var key = this.GetProviderId(MetadataProviders.Tvdb);
if (string.IsNullOrWhiteSpace(key))
{
key = this.GetProviderId(MetadataProviders.Imdb);
}
if (string.IsNullOrWhiteSpace(key))
{
key = base.CreateUserDataKey();
}
return key;
} }
/// <summary> /// <summary>

@ -439,7 +439,7 @@ namespace MediaBrowser.Server.Startup.Common
var innerProgress = new ActionableProgress<double>(); var innerProgress = new ActionableProgress<double>();
innerProgress.RegisterAction(p => progress.Report((.75 * p) + 15)); innerProgress.RegisterAction(p => progress.Report((.75 * p) + 15));
ImageProcessor = new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, GetImageEncoder()); ImageProcessor = GetImageProcessor();
RegisterSingleInstance(ImageProcessor); RegisterSingleInstance(ImageProcessor);
TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager); TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager);
@ -543,6 +543,18 @@ namespace MediaBrowser.Server.Startup.Common
await ((UserManager)UserManager).Initialize().ConfigureAwait(false); await ((UserManager)UserManager).Initialize().ConfigureAwait(false);
} }
private IImageProcessor GetImageProcessor()
{
var maxConcurrentImageProcesses = Math.Max(Environment.ProcessorCount, 4);
if (_startupOptions.ContainsOption("-imagethreads"))
{
int.TryParse(_startupOptions.GetOption("-imagethreads"), NumberStyles.Any, CultureInfo.InvariantCulture, out maxConcurrentImageProcesses);
}
return new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, GetImageEncoder(), maxConcurrentImageProcesses);
}
private IImageEncoder GetImageEncoder() private IImageEncoder GetImageEncoder()
{ {
if (!_startupOptions.ContainsOption("-enablegdi")) if (!_startupOptions.ContainsOption("-enablegdi"))

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
//[assembly: AssemblyVersion("3.0.*")] //[assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyVersion("3.0.5597.0")] [assembly: AssemblyVersion("3.0.5597.1")]

Loading…
Cancel
Save