3.0.5597.1

This commit is contained in:
Luke Pulverenti 2015-04-29 13:39:23 -04:00
parent 88191e01da
commit a75ce4197d
5 changed files with 50 additions and 13 deletions

View File

@ -53,11 +53,12 @@ namespace Emby.Drawing
private readonly IImageEncoder _imageEncoder; private readonly IImageEncoder _imageEncoder;
private readonly SemaphoreSlim _imageProcessingSemaphore; private readonly SemaphoreSlim _imageProcessingSemaphore;
public ImageProcessor(ILogger logger, public ImageProcessor(ILogger logger,
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

View File

@ -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)

View File

@ -61,7 +61,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// airdate, dvd or absolute /// airdate, dvd or absolute
/// </summary> /// </summary>
public string DisplayOrder { get; set; } public string DisplayOrder { get; set; }
/// <summary> /// <summary>
/// Gets or sets the status. /// Gets or sets the status.
/// </summary> /// </summary>
@ -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>
@ -188,7 +200,7 @@ namespace MediaBrowser.Controller.Entities.TV
public IEnumerable<Episode> GetEpisodes(User user) public IEnumerable<Episode> GetEpisodes(User user)
{ {
var config = user.Configuration; var config = user.Configuration;
return GetEpisodes(user, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes); return GetEpisodes(user, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
} }

View File

@ -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"))

View File

@ -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")]