Use enums for encoding options (#12561)

This commit is contained in:
Tim Eisele
2024-09-09 16:43:37 +02:00
committed by GitHub
parent 54f663b0f3
commit 0d85af019c
20 changed files with 884 additions and 476 deletions

View File

@@ -128,7 +128,7 @@ public class DynamicHlsPlaylistGenerator : IDynamicHlsPlaylistGenerator
return false;
}
internal static bool IsExtractionAllowedForFile(ReadOnlySpan<char> filePath, string[] allowedExtensions)
internal static bool IsExtractionAllowedForFile(ReadOnlySpan<char> filePath, IReadOnlyList<string> allowedExtensions)
{
var extension = Path.GetExtension(filePath);
if (extension.IsEmpty)
@@ -138,7 +138,7 @@ public class DynamicHlsPlaylistGenerator : IDynamicHlsPlaylistGenerator
// Remove the leading dot
var extensionWithoutDot = extension[1..];
for (var i = 0; i < allowedExtensions.Length; i++)
for (var i = 0; i < allowedExtensions.Count; i++)
{
var allowedExtension = allowedExtensions[i].AsSpan().TrimStart('.');
if (extensionWithoutDot.Equals(allowedExtension, StringComparison.OrdinalIgnoreCase))