mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 10:29:01 -07:00
26 lines
883 B
C#
26 lines
883 B
C#
using System;
|
|
using System.IO;
|
|
using Emby.Naming.Common;
|
|
using Jellyfin.Extensions;
|
|
|
|
namespace Emby.Naming.Audio
|
|
{
|
|
/// <summary>
|
|
/// Static helper class to determine if file at path is audio file.
|
|
/// </summary>
|
|
public static class AudioFileParser
|
|
{
|
|
/// <summary>
|
|
/// Static helper method to determine if file at path is audio file.
|
|
/// </summary>
|
|
/// <param name="path">Path to file.</param>
|
|
/// <param name="options"><see cref="NamingOptions"/> containing AudioFileExtensions.</param>
|
|
/// <returns>True if file at path is audio file.</returns>
|
|
public static bool IsAudioFile(string path, NamingOptions options)
|
|
{
|
|
var extension = Path.GetExtension(path.AsSpan());
|
|
return options.AudioFileExtensions.Contains(extension, StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
}
|
|
}
|