You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs

35 lines
920 B

using System.Collections.Generic;
using NzbDrone.Core.Qualities;
namespace NzbDrone.Core.MediaFiles
{
public static class MediaFileExtensions
{
private static Dictionary<string, Quality> _fileExtensions;
static MediaFileExtensions()
{
_fileExtensions = new Dictionary<string, Quality>
{
{ ".mp3", Quality.Unknown },
{ ".m4a", Quality.Unknown },
{ ".ogg", Quality.Unknown },
{ ".flac", Quality.FLAC },
};
}
public static HashSet<string> Extensions => new HashSet<string>(_fileExtensions.Keys);
public static Quality GetQualityForExtension(string extension)
{
if (_fileExtensions.ContainsKey(extension))
{
return _fileExtensions[extension];
}
return Quality.Unknown;
}
}
}