From 3fb3ee074a375d0afd4d7d81252ba535d885afb8 Mon Sep 17 00:00:00 2001 From: David Ullmer Date: Tue, 17 Aug 2021 18:11:38 +0200 Subject: Remove splashscreen generation from IImageEncoder and add IImageGenerator --- MediaBrowser.Controller/Drawing/GeneratedImages.cs | 13 +++++++++++++ MediaBrowser.Controller/Drawing/IImageEncoder.cs | 6 ------ MediaBrowser.Controller/Drawing/IImageGenerator.cs | 17 +++++++++++++++++ .../Drawing/SplashscreenOptions.cs | 20 +------------------- 4 files changed, 31 insertions(+), 25 deletions(-) create mode 100644 MediaBrowser.Controller/Drawing/GeneratedImages.cs create mode 100644 MediaBrowser.Controller/Drawing/IImageGenerator.cs (limited to 'MediaBrowser.Controller/Drawing') diff --git a/MediaBrowser.Controller/Drawing/GeneratedImages.cs b/MediaBrowser.Controller/Drawing/GeneratedImages.cs new file mode 100644 index 000000000..47b60979b --- /dev/null +++ b/MediaBrowser.Controller/Drawing/GeneratedImages.cs @@ -0,0 +1,13 @@ +namespace MediaBrowser.Controller.Drawing +{ + /// + /// Which generated images an supports. + /// + public enum GeneratedImages + { + /// + /// The splashscreen. + /// + Splashscreen + } +} diff --git a/MediaBrowser.Controller/Drawing/IImageEncoder.cs b/MediaBrowser.Controller/Drawing/IImageEncoder.cs index 57d73699f..4e67cfee4 100644 --- a/MediaBrowser.Controller/Drawing/IImageEncoder.cs +++ b/MediaBrowser.Controller/Drawing/IImageEncoder.cs @@ -74,11 +74,5 @@ namespace MediaBrowser.Controller.Drawing /// The options to use when creating the collage. /// Optional. void CreateImageCollage(ImageCollageOptions options, string? libraryName); - - /// - /// Creates a splashscreen image. - /// - /// The options to use when creating the splashscreen. - void CreateSplashscreen(SplashscreenOptions options); } } diff --git a/MediaBrowser.Controller/Drawing/IImageGenerator.cs b/MediaBrowser.Controller/Drawing/IImageGenerator.cs new file mode 100644 index 000000000..21699c3f0 --- /dev/null +++ b/MediaBrowser.Controller/Drawing/IImageGenerator.cs @@ -0,0 +1,17 @@ +namespace MediaBrowser.Controller.Drawing +{ + public interface IImageGenerator + { + /// + /// Gets the supported generated images of the image generator. + /// + /// The supported images. + GeneratedImages[] GetSupportedImages(); + + /// + /// Generates a splashscreen. + /// + /// The options used to generate the splashscreen. + void GenerateSplashscreen(SplashscreenOptions generationOptions); + } +} diff --git a/MediaBrowser.Controller/Drawing/SplashscreenOptions.cs b/MediaBrowser.Controller/Drawing/SplashscreenOptions.cs index 0534d60b6..ba268b8eb 100644 --- a/MediaBrowser.Controller/Drawing/SplashscreenOptions.cs +++ b/MediaBrowser.Controller/Drawing/SplashscreenOptions.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace MediaBrowser.Controller.Drawing { /// @@ -10,30 +8,14 @@ namespace MediaBrowser.Controller.Drawing /// /// Initializes a new instance of the class. /// - /// The portrait input paths. - /// The landscape input paths. /// The output path. - /// Optional. The image width. - /// Optional. The image height. /// Optional. Apply a darkening filter. - public SplashscreenOptions(IReadOnlyList portraitInputPaths, IReadOnlyList landscapeInputPaths, string outputPath, bool applyFilter = false) + public SplashscreenOptions(string outputPath, bool applyFilter = false) { - PortraitInputPaths = portraitInputPaths; - LandscapeInputPaths = landscapeInputPaths; OutputPath = outputPath; ApplyFilter = applyFilter; } - /// - /// Gets or sets the poster input paths. - /// - public IReadOnlyList PortraitInputPaths { get; set; } - - /// - /// Gets or sets the landscape input paths. - /// - public IReadOnlyList LandscapeInputPaths { get; set; } - /// /// Gets or sets the output path. /// -- cgit v1.2.3