From 220443eca1dfef08a2a0e000ac5963e18af073fc Mon Sep 17 00:00:00 2001 From: cvium Date: Fri, 10 Dec 2021 14:23:31 +0100 Subject: Simplify StackResolver --- Emby.Naming/Video/FileStack.cs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Emby.Naming/Video/FileStack.cs') diff --git a/Emby.Naming/Video/FileStack.cs b/Emby.Naming/Video/FileStack.cs index a4a4716ca..bd635a9f7 100644 --- a/Emby.Naming/Video/FileStack.cs +++ b/Emby.Naming/Video/FileStack.cs @@ -12,25 +12,30 @@ namespace Emby.Naming.Video /// /// Initializes a new instance of the class. /// - public FileStack() + /// The stack name. + /// Whether the stack files are directories. + /// The stack files. + public FileStack(string name, bool isDirectory, IReadOnlyList files) { - Files = new List(); + Name = name; + IsDirectoryStack = isDirectory; + Files = files; } /// - /// Gets or sets name of file stack. + /// Gets the name of file stack. /// - public string Name { get; set; } = string.Empty; + public string Name { get; } /// - /// Gets or sets list of paths in stack. + /// Gets the list of paths in stack. /// - public List Files { get; set; } + public IReadOnlyList Files { get; } /// - /// Gets or sets a value indicating whether stack is directory stack. + /// Gets a value indicating whether stack is directory stack. /// - public bool IsDirectoryStack { get; set; } + public bool IsDirectoryStack { get; } /// /// Helper function to determine if path is in the stack. @@ -45,12 +50,7 @@ namespace Emby.Naming.Video return false; } - if (IsDirectoryStack == isDirectory) - { - return Files.Contains(file, StringComparer.OrdinalIgnoreCase); - } - - return false; + return IsDirectoryStack == isDirectory && Files.Contains(file, StringComparer.OrdinalIgnoreCase); } } } -- cgit v1.2.3