2013-09-12 06:33:28 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using NzbDrone.Core.Qualities;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
{
|
|
|
|
|
public static class MediaFileExtensions
|
|
|
|
|
{
|
2013-09-12 14:36:10 +00:00
|
|
|
|
private static Dictionary<String, Quality> _fileExtensions;
|
2013-09-12 06:33:28 +00:00
|
|
|
|
|
|
|
|
|
static MediaFileExtensions()
|
|
|
|
|
{
|
2013-09-12 14:36:10 +00:00
|
|
|
|
_fileExtensions = new Dictionary<String, Quality>
|
2013-09-12 06:33:28 +00:00
|
|
|
|
{
|
2013-09-12 14:36:10 +00:00
|
|
|
|
{ ".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 },
|
|
|
|
|
{ ".vob", Quality.SDTV },
|
|
|
|
|
{ ".nrg", Quality.SDTV },
|
|
|
|
|
{ ".pva", Quality.SDTV },
|
|
|
|
|
{ ".wmv", Quality.SDTV },
|
|
|
|
|
{ ".asf", Quality.SDTV },
|
|
|
|
|
{ ".asx", Quality.SDTV },
|
|
|
|
|
{ ".ogm", 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 },
|
2013-09-12 06:33:28 +00:00
|
|
|
|
|
|
|
|
|
//DVD
|
2013-09-12 14:36:10 +00:00
|
|
|
|
{ ".img", Quality.DVD },
|
|
|
|
|
{ ".iso", Quality.DVD },
|
2013-09-12 06:33:28 +00:00
|
|
|
|
|
|
|
|
|
//HD
|
2013-09-12 14:36:10 +00:00
|
|
|
|
{ ".mkv", Quality.HDTV720p },
|
|
|
|
|
{ ".ts", Quality.HDTV720p },
|
|
|
|
|
{ ".m2ts", Quality.HDTV720p }
|
2013-09-12 06:33:28 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static HashSet<String> Extensions
|
|
|
|
|
{
|
2013-09-12 14:36:10 +00:00
|
|
|
|
get { return new HashSet<String>(_fileExtensions.Keys); }
|
2013-09-12 06:33:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Quality FindQuality(string extension)
|
|
|
|
|
{
|
2013-09-12 14:36:10 +00:00
|
|
|
|
if (_fileExtensions.ContainsKey(extension))
|
2013-09-12 06:33:28 +00:00
|
|
|
|
{
|
2013-09-12 14:36:10 +00:00
|
|
|
|
return _fileExtensions[extension];
|
2013-09-12 06:33:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-09-12 14:36:10 +00:00
|
|
|
|
return Quality.Unknown;
|
2013-09-12 06:33:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|