From 838e5d05d51c4c171c07d512f741304a6dc58f24 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 11 Aug 2019 16:52:37 +0200 Subject: Document all public/internal members of Emby.Drawing Forces all new public/internal members to be documented. Enables TreatWarningsAsErrors for Emby.Drawing --- Emby.Server.Implementations/ApplicationHost.cs | 21 ++++++--------------- Emby.Server.Implementations/Dto/DtoService.cs | 2 +- 2 files changed, 7 insertions(+), 16 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 09847b2f8..b620f6be2 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -510,13 +510,8 @@ namespace Emby.Server.Implementations return AllConcreteTypes.Where(i => currentType.IsAssignableFrom(i)); } - /// - /// Gets the exports. - /// - /// The type - /// if set to true [manage lifetime]. - /// IEnumerable{``0}. - public IEnumerable GetExports(bool manageLifetime = true) + /// + public IReadOnlyCollection GetExports(bool manageLifetime = true) { var parts = GetExportTypes() .Select(CreateInstanceSafe) @@ -538,6 +533,7 @@ namespace Emby.Server.Implementations /// /// Runs the startup tasks. /// + /// . public async Task RunStartupTasksAsync() { Logger.LogInformation("Running startup tasks"); @@ -550,7 +546,7 @@ namespace Emby.Server.Implementations Logger.LogInformation("ServerId: {0}", SystemId); - var entryPoints = GetExports().ToList(); + var entryPoints = GetExports(); var stopWatch = new Stopwatch(); stopWatch.Start(); @@ -801,7 +797,7 @@ namespace Emby.Server.Implementations serviceCollection.AddSingleton(HttpServer); - ImageProcessor = GetImageProcessor(); + ImageProcessor = new ImageProcessor(LoggerFactory.CreateLogger(), ServerConfigurationManager.ApplicationPaths, FileSystemManager, ImageEncoder, () => LibraryManager, () => MediaEncoder); serviceCollection.AddSingleton(ImageProcessor); TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager, ServerConfigurationManager); @@ -953,11 +949,6 @@ namespace Emby.Server.Implementations } } - private IImageProcessor GetImageProcessor() - { - return new ImageProcessor(LoggerFactory, ServerConfigurationManager.ApplicationPaths, FileSystemManager, ImageEncoder, () => LibraryManager, () => MediaEncoder); - } - /// /// Gets the user repository. /// @@ -1087,7 +1078,7 @@ namespace Emby.Server.Implementations GetExports(), GetExports()); - ImageProcessor.AddParts(GetExports()); + ImageProcessor.ImageEnhancers = GetExports(); LiveTvManager.AddParts(GetExports(), GetExports(), GetExports()); diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 6e7aa1313..1a7f10634 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -1364,7 +1364,7 @@ namespace Emby.Server.Implementations.Dto return null; } - var supportedEnhancers = _imageProcessor.GetSupportedEnhancers(item, ImageType.Primary); + var supportedEnhancers = _imageProcessor.GetSupportedEnhancers(item, ImageType.Primary).ToArray(); ImageDimensions size; -- cgit v1.2.3