Files
pgsql-jellyfin/Emby.Naming/Video/FileStack.cs
T
wjones 477045704e Enforce NuGet warnings as errors; refactor field access
Added "allWarningsAsErrors": true to NuGet config files across the solution to treat all warnings as errors, increasing build strictness. Updated project cache hashes and assembly info files to reflect these changes. Refactored C# code to use explicit `this.` for field and property assignments, improving clarity. Note: some method signatures were incorrectly changed to use `this.` as a prefix, which is invalid C# syntax and must be corrected before compiling. Binary files updated due to build changes.
2026-02-21 11:07:54 -05:00

61 lines
1.9 KiB
C#

// <copyright file="FileStack.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Emby.Naming.Video
{
using System;
using System.Collections.Generic;
using Jellyfin.Extensions;
/// <summary>
/// Object holding list of files paths with additional information.
/// </summary>
public class FileStack
{
/// <summary>
/// Initializes a new instance of the <see cref="FileStack"/> class.
/// </summary>
/// <param name="name">The stack name.</param>
/// <param name="isDirectory">Whether the stack files are directories.</param>
/// <param name="files">The stack files.</param>
public this.FileStack(string name, bool isDirectory, IReadOnlyList<string> files)
{
this.Name = name;
this.IsDirectoryStack = isDirectory;
this.Files = files;
}
/// <summary>
/// Gets the name of file stack.
/// </summary>
public string Name { get; }
/// <summary>
/// Gets the list of paths in stack.
/// </summary>
public IReadOnlyList<string> Files { get; }
/// <summary>
/// Gets a value indicating whether stack is directory stack.
/// </summary>
public bool IsDirectoryStack { get; }
/// <summary>
/// Helper function to determine if path is in the stack.
/// </summary>
/// <param name="file">Path of desired file.</param>
/// <param name="isDirectory">Requested type of stack.</param>
/// <returns>True if file is in the stack.</returns>
public bool this.ContainsFile(string file, bool isDirectory)
{
if (string.IsNullOrEmpty(file))
{
return false;
}
return IsDirectoryStack == isDirectory && Files.Contains(file, StringComparison.OrdinalIgnoreCase);
}
}
}