1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-25 02:30:20 +02:00
Sonarr/src/NzbDrone.Core/MediaFiles/MediaFileExtensions.cs

86 lines
2.7 KiB
C#
Raw Normal View History

using System;
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>
{
{ ".m4v", Quality.SDTV },
{ ".3gp", Quality.SDTV },
{ ".nsv", Quality.SDTV },
{ ".ty", Quality.SDTV },
{ ".strm", Quality.SDTV },
{ ".rm", Quality.SDTV },
{ ".rmvb", Quality.SDTV },
{ ".m3u", Quality.SDTV },
{ ".ifo", Quality.SDTV },
{ ".mov", Quality.SDTV },
{ ".qt", Quality.SDTV },
{ ".divx", Quality.SDTV },
{ ".xvid", Quality.SDTV },
{ ".bivx", Quality.SDTV },
{ ".nrg", Quality.SDTV },
{ ".pva", Quality.SDTV },
{ ".wmv", Quality.SDTV },
{ ".asf", Quality.SDTV },
{ ".asx", Quality.SDTV },
{ ".ogm", Quality.SDTV },
2014-01-27 04:08:28 +03:00
{ ".ogv", Quality.SDTV },
{ ".m2v", Quality.SDTV },
{ ".avi", Quality.SDTV },
{ ".bin", Quality.SDTV },
{ ".dat", Quality.SDTV },
{ ".dvr-ms", Quality.SDTV },
{ ".mpg", Quality.SDTV },
{ ".mpeg", Quality.SDTV },
{ ".mp4", Quality.SDTV },
{ ".avc", Quality.SDTV },
{ ".vp3", Quality.SDTV },
{ ".svq3", Quality.SDTV },
{ ".nuv", Quality.SDTV },
{ ".viv", Quality.SDTV },
{ ".dv", Quality.SDTV },
{ ".fli", Quality.SDTV },
{ ".flv", Quality.SDTV },
{ ".wpl", Quality.SDTV },
//DVD
{ ".img", Quality.DVD },
{ ".iso", Quality.DVD },
2013-09-12 18:08:48 +03:00
{ ".vob", Quality.DVD },
//HD
{ ".mkv", Quality.HDTV720p },
{ ".ts", Quality.HDTV720p },
2014-11-08 19:56:01 +02:00
{ ".wtv", Quality.HDTV720p },
2013-09-12 18:08:48 +03:00
//Bluray
{ ".m2ts", Quality.Bluray720p }
};
}
public static HashSet<String> Extensions
{
get { return new HashSet<String>(_fileExtensions.Keys); }
}
2013-09-12 18:08:48 +03:00
public static Quality GetQualityForExtension(string extension)
{
if (_fileExtensions.ContainsKey(extension))
{
return _fileExtensions[extension];
}
return Quality.Unknown;
}
}
}