2020-02-22 21:00:07 +00:00
|
|
|
using System;
|
2013-09-01 02:44:55 +00:00
|
|
|
using System.IO;
|
2016-10-10 20:36:58 +00:00
|
|
|
using System.Linq;
|
2013-09-01 02:44:55 +00:00
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
using NLog;
|
2014-12-02 06:26:25 +00:00
|
|
|
using NzbDrone.Common.Extensions;
|
2016-06-02 17:04:41 +00:00
|
|
|
using NzbDrone.Common.Instrumentation;
|
2013-09-12 06:33:28 +00:00
|
|
|
using NzbDrone.Core.MediaFiles;
|
2013-09-01 02:44:55 +00:00
|
|
|
using NzbDrone.Core.Qualities;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Parser
|
|
|
|
{
|
|
|
|
public class QualityParser
|
|
|
|
{
|
2016-06-02 17:04:41 +00:00
|
|
|
private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(QualityParser));
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2023-04-29 21:41:33 +00:00
|
|
|
private static readonly Regex SourceRegex = new (@"\b(?:
|
2023-06-19 20:22:15 +00:00
|
|
|
(?<bluray>M?Blu[-_. ]?Ray|HD[-_. ]?DVD|BD(?!$)|UHD2?BD|BDISO|BDMux|BD25|BD50|BR[-_. ]?DISK)|
|
|
|
|
(?<webdl>WEB[-_. ]?DL(?:mux)?|AmazonHD|AmazonSD|iTunesHD|MaxdomeHD|NetflixU?HD|WebHD|HBOMaxHD|DisneyHD|[. ]WEB[. ](?:[xh][ .]?26[45]|DDP?5[. ]1)|[. ](?-i:WEB)$|(?:\d{3,4}0p)[-. ]WEB[-. ]|[-. ]WEB[-. ]\d{3,4}0p|\b\s\/\sWEB\s\/\s\b|(?:AMZN|NF|DP)[. -]WEB[. -](?!Rip))|
|
2023-04-29 21:41:33 +00:00
|
|
|
(?<webrip>WebRip|Web-Rip|WEBMux)|
|
|
|
|
(?<hdtv>HDTV)|
|
|
|
|
(?<bdrip>BDRip|BDLight)|
|
|
|
|
(?<brrip>BRRip)|
|
2023-05-30 16:52:44 +00:00
|
|
|
(?<dvdr>\d?x?M?DVD-?[R59])|
|
2023-04-29 21:41:33 +00:00
|
|
|
(?<dvd>DVD(?!-R)|DVDRip|xvidvd)|
|
|
|
|
(?<dsr>WS[-_. ]DSR|DSR)|
|
|
|
|
(?<regional>R[0-9]{1}|REGIONAL)|
|
|
|
|
(?<scr>SCR|SCREENER|DVDSCR|DVDSCREENER)|
|
|
|
|
(?<ts>TS[-_. ]|TELESYNC|HD-TS|HDTS|PDVD|TSRip|HDTSRip)|
|
|
|
|
(?<tc>TC|TELECINE|HD-TC|HDTC)|
|
|
|
|
(?<cam>CAMRIP|CAM|HD-?CAM(?:Rip)?|HQCAM)|
|
|
|
|
(?<wp>WORKPRINT|WP)|
|
|
|
|
(?<pdtv>PDTV)|
|
|
|
|
(?<sdtv>SDTV)|
|
|
|
|
(?<tvrip>TVRip)
|
|
|
|
)(?:\b|$|[ .])",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
|
|
|
|
|
|
|
|
private static readonly Regex RawHDRegex = new (@"\b(?<rawhd>RawHD|Raw[-_. ]HD)\b",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
private static readonly Regex MPEG2Regex = new (@"\b(?<mpeg2>MPEG[-_. ]?2)\b");
|
|
|
|
|
2023-08-20 16:23:04 +00:00
|
|
|
private static readonly Regex BRDISKRegex = new (@"^(?!.*\b((?<!HD[._ -]|HD)DVD|BDRip|720p|MKV|XviD|WMV|d3g|(BD)?REMUX|^(?=.*1080p)(?=.*HEVC)|[xh][-_. ]?26[45]|German.*[DM]L|((?<=\d{4}).*German.*([DM]L)?)(?=.*\b(AVC|HEVC|VC[-_. ]?1|MVC|MPEG[-_. ]?2)\b))\b)(((?=.*\b(Blu[-_. ]?ray|BD|HD[-_. ]?DVD)\b)(?=.*\b(AVC|HEVC|VC[-_. ]?1|MVC|MPEG[-_. ]?2|BDMV|ISO)\b))|^((?=.*\b(^((?=.*\b((.*_)?COMPLETE.*|Dis[ck])\b)(?=.*(Blu[-_. ]?ray|HD[-_. ]?DVD)))|3D[-_. ]?BD|BR[-_. ]?DISK|Full[-_. ]?Blu[-_. ]?ray|^((?=.*((BD|UHD)[-_. ]?(25|50|66|100|ISO)))))))).*",
|
2023-04-29 21:41:33 +00:00
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
|
|
|
private static readonly Regex ProperRegex = new (@"\b(?<proper>proper)\b",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
|
2023-05-02 00:48:24 +00:00
|
|
|
private static readonly Regex RepackRegex = new (@"\b(?<repack>repack\d?|rerip\d?)\b",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2023-04-29 21:41:33 +00:00
|
|
|
|
2023-05-02 00:48:24 +00:00
|
|
|
private static readonly Regex VersionRegex = new (@"\d[-._ ]?v(?<version>\d)[-._ ]|\[v(?<version>\d)\]|repack(?<version>\d)|rerip(?<version>\d)",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2023-04-29 21:41:33 +00:00
|
|
|
|
|
|
|
private static readonly Regex RealRegex = new (@"\b(?<real>REAL)\b",
|
|
|
|
RegexOptions.Compiled);
|
|
|
|
|
|
|
|
private static readonly Regex ResolutionRegex = new (@"\b(?:(?<R360p>360p)|(?<R480p>480p|640x480|848x480)|(?<R540p>540p)|(?<R576p>576p)|(?<R720p>720p|1280x720|960p)|(?<R1080p>1080p|1920x1080|1440p|FHD|1080i|4kto1080p)|(?<R2160p>2160p|3840x2160|4k[-_. ](?:UHD|HEVC|BD|H\.?265)|(?:UHD|HEVC|BD|H\.?265)[-_. ]4k))\b",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2014-05-04 11:26:02 +00:00
|
|
|
|
2022-11-20 18:27:45 +00:00
|
|
|
// Handle cases where no resolution is in the release name; assume if UHD then 4k
|
2023-04-29 21:41:33 +00:00
|
|
|
private static readonly Regex ImpliedResolutionRegex = new (@"\b(?<R2160p>UHD)\b",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2021-01-12 18:37:40 +00:00
|
|
|
|
2023-04-29 21:41:33 +00:00
|
|
|
private static readonly Regex CodecRegex = new (@"\b(?:(?<x264>x264)|(?<h264>h264)|(?<xvidhd>XvidHD)|(?<xvid>X-?vid)|(?<divx>divx))\b",
|
|
|
|
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2023-04-29 21:41:33 +00:00
|
|
|
private static readonly Regex OtherSourceRegex = new (@"(?<hdtv>HD[-_. ]TV)|(?<sdtv>SD[-_. ]TV)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2014-06-16 14:57:55 +00:00
|
|
|
|
2023-04-29 21:41:33 +00:00
|
|
|
private static readonly Regex AnimeBlurayRegex = new (@"bd(?:720|1080|2160)|(?<=[-_. (\[])bd(?=[-_. )\]])", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
|
|
|
private static readonly Regex AnimeWebDlRegex = new (@"\[WEB\]|[\[\(]WEB[ .]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2014-05-19 19:14:41 +00:00
|
|
|
|
2023-04-29 21:41:33 +00:00
|
|
|
private static readonly Regex HighDefPdtvRegex = new (@"hr[-_. ]ws", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2014-07-09 05:45:19 +00:00
|
|
|
|
2023-04-29 21:41:33 +00:00
|
|
|
private static readonly Regex RemuxRegex = new (@"(?:[_. \[]|\d{4}p-)(?<remux>(?:(BD|UHD)[-_. ]?)?Remux)\b|(?<remux>(?:(BD|UHD)[-_. ]?)?Remux[_. ]\d{4}p)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2023-08-20 16:23:04 +00:00
|
|
|
private static readonly Regex GermanRemuxRegex = new Regex(@"((?<=\d{4}).*German.*([DM]L)?)(?=.*\b(AVC|HEVC|VC[_. -]?1|MVC|MPEG[_. -]?2))(?=.*Blu-?ray)", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
2019-10-31 03:46:40 +00:00
|
|
|
|
2013-09-01 02:44:55 +00:00
|
|
|
public static QualityModel ParseQuality(string name)
|
|
|
|
{
|
2014-03-13 20:12:42 +00:00
|
|
|
Logger.Debug("Trying to parse quality for {0}", name);
|
2013-09-01 02:44:55 +00:00
|
|
|
|
|
|
|
name = name.Trim();
|
2019-10-31 03:46:40 +00:00
|
|
|
|
|
|
|
var result = ParseQualityName(name);
|
|
|
|
|
|
|
|
// Based on extension
|
|
|
|
if (result.Quality == Quality.Unknown && !name.ContainsInvalidPathChars())
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
result.Quality = MediaFileExtensions.GetQualityForExtension(Path.GetExtension(name));
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Extension;
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Extension;
|
|
|
|
result.ModifierDetectionSource = QualityDetectionSource.Extension;
|
2019-10-31 03:46:40 +00:00
|
|
|
}
|
|
|
|
catch (ArgumentException)
|
|
|
|
{
|
|
|
|
// Swallow exception for cases where string contains illegal
|
|
|
|
// path characters.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static QualityModel ParseQualityName(string name)
|
|
|
|
{
|
2020-05-25 04:42:03 +00:00
|
|
|
var normalizedName = name.Replace('_', ' ').Trim();
|
2015-08-21 05:50:26 +00:00
|
|
|
var result = ParseQualityModifiers(name, normalizedName);
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
var sourceMatches = SourceRegex.Matches(normalizedName);
|
|
|
|
var sourceMatch = sourceMatches.OfType<Match>().LastOrDefault();
|
2014-05-04 11:26:02 +00:00
|
|
|
var resolution = ParseResolution(normalizedName);
|
|
|
|
var codecRegex = CodecRegex.Match(normalizedName);
|
2023-08-20 16:23:04 +00:00
|
|
|
var remuxMatch = RemuxRegex.IsMatch(normalizedName) || GermanRemuxRegex.IsMatch(normalizedName);
|
2019-10-31 03:46:40 +00:00
|
|
|
var brDiskMatch = BRDISKRegex.IsMatch(normalizedName);
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2020-11-06 02:36:14 +00:00
|
|
|
if (RawHDRegex.IsMatch(normalizedName) && !brDiskMatch)
|
|
|
|
{
|
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.Quality = Quality.RAWHD;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2020-08-16 01:54:20 +00:00
|
|
|
if (resolution != Resolution.Unknown)
|
|
|
|
{
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
}
|
|
|
|
|
2016-10-10 20:36:58 +00:00
|
|
|
if (sourceMatch != null && sourceMatch.Success)
|
2013-09-01 02:44:55 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
2016-10-10 20:36:58 +00:00
|
|
|
if (sourceMatch.Groups["bluray"].Success)
|
2013-09-01 02:44:55 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
if (brDiskMatch)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.BRDISK;
|
|
|
|
return result;
|
|
|
|
}
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2018-08-05 14:28:05 +00:00
|
|
|
if (codecRegex.Groups["xvid"].Success || codecRegex.Groups["divx"].Success)
|
2017-01-29 19:22:04 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.Bluray480p;
|
2017-01-29 19:22:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (resolution == Resolution.R2160p)
|
|
|
|
{
|
|
|
|
result.Quality = remuxMatch ? Quality.Remux2160p : Quality.Bluray2160p;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
2016-10-10 20:36:58 +00:00
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (resolution == Resolution.R1080p)
|
|
|
|
{
|
|
|
|
result.Quality = remuxMatch ? Quality.Remux1080p : Quality.Bluray1080p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2022-02-02 20:48:59 +00:00
|
|
|
if (resolution == Resolution.R720p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.Bluray720p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (resolution == Resolution.R576p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.Bluray576p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2021-11-28 07:38:04 +00:00
|
|
|
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
|
|
|
resolution == Resolution.R540p)
|
2019-10-31 03:46:40 +00:00
|
|
|
{
|
|
|
|
result.Quality = Quality.Bluray480p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Treat a remux without a source as 1080p, not 720p.
|
2023-04-29 21:47:15 +00:00
|
|
|
// 720p remux should fallback as 720p BluRay
|
|
|
|
if (remuxMatch && resolution != Resolution.R720p)
|
2019-10-31 03:46:40 +00:00
|
|
|
{
|
|
|
|
result.Quality = Quality.Remux1080p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
result.Quality = Quality.Bluray720p;
|
2013-09-01 02:44:55 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2016-10-10 20:36:58 +00:00
|
|
|
if (sourceMatch.Groups["webdl"].Success)
|
2014-05-25 06:21:53 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
if (resolution == Resolution.R2160p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.WEBDL2160p;
|
|
|
|
return result;
|
|
|
|
}
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (resolution == Resolution.R1080p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.WEBDL1080p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R720p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.WEBDL720p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (name.Contains("[WEBDL]"))
|
|
|
|
{
|
|
|
|
result.Quality = Quality.WEBDL720p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
result.Quality = Quality.WEBDL480p;
|
2013-09-01 02:44:55 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["webrip"].Success)
|
2013-09-01 02:44:55 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
if (resolution == Resolution.R2160p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.WEBRip2160p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R1080p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.WEBRip1080p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R720p)
|
2017-07-01 12:01:38 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.WEBRip720p;
|
2017-07-01 12:01:38 +00:00
|
|
|
return result;
|
|
|
|
}
|
2018-08-05 14:28:05 +00:00
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.WEBRip480p;
|
|
|
|
return result;
|
|
|
|
}
|
2018-08-05 14:28:05 +00:00
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["scr"].Success)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.DVDSCR;
|
2018-08-05 14:28:05 +00:00
|
|
|
return result;
|
2013-09-01 02:44:55 +00:00
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["cam"].Success)
|
2017-01-29 19:22:04 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.CAM;
|
2017-01-29 19:22:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["ts"].Success)
|
2013-09-01 02:44:55 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.TELESYNC;
|
|
|
|
result.Quality.Resolution = (int)resolution;
|
2013-09-01 02:44:55 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["tc"].Success)
|
2017-01-29 19:22:04 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.TELECINE;
|
2017-01-29 19:22:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["wp"].Success)
|
2017-01-29 19:22:04 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.WORKPRINT;
|
2017-01-29 19:22:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sourceMatch.Groups["regional"].Success)
|
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.REGIONAL;
|
2017-01-29 19:22:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["hdtv"].Success)
|
2017-01-29 19:22:04 +00:00
|
|
|
{
|
2020-11-06 02:36:14 +00:00
|
|
|
if (MPEG2Regex.IsMatch(normalizedName))
|
|
|
|
{
|
|
|
|
result.Quality = Quality.RAWHD;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (resolution == Resolution.R2160p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.HDTV2160p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R1080p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.HDTV1080p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R720p)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.HDTV720p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (name.Contains("[HDTV]"))
|
|
|
|
{
|
|
|
|
result.Quality = Quality.HDTV720p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
result.Quality = Quality.SDTV;
|
2017-01-29 19:22:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["bdrip"].Success ||
|
|
|
|
sourceMatch.Groups["brrip"].Success)
|
2017-01-29 19:22:04 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
switch (resolution)
|
|
|
|
{
|
|
|
|
case Resolution.R720p:
|
|
|
|
result.Quality = Quality.Bluray720p;
|
|
|
|
return result;
|
|
|
|
case Resolution.R1080p:
|
|
|
|
result.Quality = Quality.Bluray1080p;
|
|
|
|
return result;
|
2021-01-03 01:04:56 +00:00
|
|
|
case Resolution.R2160p:
|
|
|
|
result.Quality = Quality.Bluray2160p;
|
|
|
|
return result;
|
2019-10-31 03:46:40 +00:00
|
|
|
case Resolution.R576p:
|
|
|
|
result.Quality = Quality.Bluray576p;
|
|
|
|
return result;
|
|
|
|
default:
|
|
|
|
result.Quality = Quality.Bluray480p;
|
|
|
|
return result;
|
|
|
|
}
|
2017-01-29 19:22:04 +00:00
|
|
|
}
|
|
|
|
|
2020-06-04 02:18:07 +00:00
|
|
|
if (sourceMatch.Groups["dvdr"].Success)
|
|
|
|
{
|
|
|
|
result.Quality = Quality.DVDR;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
if (sourceMatch.Groups["dvd"].Success)
|
2017-01-29 19:22:04 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.DVD;
|
2017-01-29 19:22:04 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2016-10-10 20:36:58 +00:00
|
|
|
if (sourceMatch.Groups["pdtv"].Success ||
|
|
|
|
sourceMatch.Groups["sdtv"].Success ||
|
|
|
|
sourceMatch.Groups["dsr"].Success ||
|
|
|
|
sourceMatch.Groups["tvrip"].Success)
|
2014-05-02 17:13:54 +00:00
|
|
|
{
|
2020-05-25 04:42:03 +00:00
|
|
|
if (resolution == Resolution.R1080p || normalizedName.ContainsIgnoreCase("1080p"))
|
2019-10-31 03:46:40 +00:00
|
|
|
{
|
|
|
|
result.Quality = Quality.HDTV1080p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (resolution == Resolution.R720p || normalizedName.ContainsIgnoreCase("720p"))
|
2019-10-31 03:46:40 +00:00
|
|
|
{
|
|
|
|
result.Quality = Quality.HDTV720p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2016-10-10 20:36:58 +00:00
|
|
|
if (HighDefPdtvRegex.IsMatch(normalizedName))
|
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.HDTV720p;
|
2014-12-07 07:23:11 +00:00
|
|
|
return result;
|
2016-10-10 20:36:58 +00:00
|
|
|
}
|
2014-05-02 17:13:54 +00:00
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.SDTV;
|
2014-07-09 05:45:19 +00:00
|
|
|
return result;
|
|
|
|
}
|
2013-09-01 02:44:55 +00:00
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
// Anime Bluray matching
|
2014-05-19 19:14:41 +00:00
|
|
|
if (AnimeBlurayRegex.Match(normalizedName).Success)
|
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
2021-11-28 07:38:04 +00:00
|
|
|
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
|
|
|
resolution == Resolution.R540p || resolution == Resolution.R576p ||
|
|
|
|
normalizedName.ContainsIgnoreCase("480p"))
|
2014-05-19 19:14:41 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.DVD;
|
2014-05-19 19:14:41 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (resolution == Resolution.R1080p || normalizedName.ContainsIgnoreCase("1080p"))
|
2014-05-19 19:14:41 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = remuxMatch ? Quality.Remux1080p : Quality.Bluray1080p;
|
2014-05-19 19:14:41 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (resolution == Resolution.R2160p || normalizedName.ContainsIgnoreCase("2160p"))
|
2019-10-31 03:46:40 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = remuxMatch ? Quality.Remux2160p : Quality.Bluray2160p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Treat a remux without a source as 1080p, not 720p.
|
2023-04-29 21:47:15 +00:00
|
|
|
// 720p remux should fallback as 720p BluRay
|
|
|
|
if (remuxMatch && resolution != Resolution.R720p)
|
2019-10-31 03:46:40 +00:00
|
|
|
{
|
2023-04-29 21:47:15 +00:00
|
|
|
result.Quality = Quality.Remux1080p;
|
2019-10-31 03:46:40 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
result.Quality = Quality.Bluray720p;
|
2014-05-19 19:14:41 +00:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2021-01-14 00:57:39 +00:00
|
|
|
if (AnimeWebDlRegex.Match(normalizedName).Success)
|
|
|
|
{
|
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
|
|
|
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
2021-11-28 07:38:04 +00:00
|
|
|
resolution == Resolution.R540p || resolution == Resolution.R576p ||
|
|
|
|
normalizedName.ContainsIgnoreCase("480p"))
|
2021-01-14 00:57:39 +00:00
|
|
|
{
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.Quality = Quality.WEBDL480p;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R1080p || normalizedName.ContainsIgnoreCase("1080p"))
|
|
|
|
{
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.Quality = Quality.WEBDL1080p;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R2160p || normalizedName.ContainsIgnoreCase("2160p"))
|
|
|
|
{
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.Quality = Quality.WEBDL2160p;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
result.Quality = Quality.WEBDL720p;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2020-08-16 01:54:20 +00:00
|
|
|
if (resolution != Resolution.Unknown)
|
2019-10-31 03:46:40 +00:00
|
|
|
{
|
2023-08-21 03:53:11 +00:00
|
|
|
var source = QualitySource.UNKNOWN;
|
2020-08-16 01:54:20 +00:00
|
|
|
var modifier = Modifier.NONE;
|
2015-11-09 23:18:02 +00:00
|
|
|
|
2020-08-16 01:54:20 +00:00
|
|
|
if (remuxMatch)
|
|
|
|
{
|
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
2023-08-21 03:53:11 +00:00
|
|
|
source = QualitySource.BLURAY;
|
2020-08-16 01:54:20 +00:00
|
|
|
modifier = Modifier.REMUX;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
var quality = MediaFileExtensions.GetQualityForExtension(name.GetPathExtension());
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2020-08-16 01:54:20 +00:00
|
|
|
if (quality != Quality.Unknown)
|
|
|
|
{
|
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Extension;
|
|
|
|
source = quality.Source;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (ArgumentException ex)
|
|
|
|
{
|
|
|
|
Logger.Debug(ex, "Unable to parse quality from extension");
|
|
|
|
}
|
|
|
|
}
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2020-08-16 01:54:20 +00:00
|
|
|
if (resolution == Resolution.R2160p)
|
|
|
|
{
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
2023-08-21 03:53:11 +00:00
|
|
|
result.Quality = source == QualitySource.UNKNOWN
|
2020-08-16 01:54:20 +00:00
|
|
|
? Quality.HDTV2160p
|
|
|
|
: QualityFinder.FindBySourceAndResolution(source, 2160, modifier);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R1080p)
|
|
|
|
{
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
2023-08-21 03:53:11 +00:00
|
|
|
result.Quality = source == QualitySource.UNKNOWN
|
2020-08-16 01:54:20 +00:00
|
|
|
? Quality.HDTV1080p
|
|
|
|
: QualityFinder.FindBySourceAndResolution(source, 1080, modifier);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (resolution == Resolution.R720p)
|
|
|
|
{
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
2023-08-21 03:53:11 +00:00
|
|
|
result.Quality = source == QualitySource.UNKNOWN
|
2020-08-16 01:54:20 +00:00
|
|
|
? Quality.HDTV720p
|
|
|
|
: QualityFinder.FindBySourceAndResolution(source, 720, modifier);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2021-11-28 07:38:04 +00:00
|
|
|
if (resolution == Resolution.R360p || resolution == Resolution.R480p ||
|
|
|
|
resolution == Resolution.R540p || resolution == Resolution.R576p)
|
2020-08-16 01:54:20 +00:00
|
|
|
{
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
2023-08-21 03:53:11 +00:00
|
|
|
result.Quality = source == QualitySource.UNKNOWN
|
2020-08-16 01:54:20 +00:00
|
|
|
? Quality.SDTV
|
|
|
|
: QualityFinder.FindBySourceAndResolution(source, 480, modifier);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
2014-05-19 19:14:41 +00:00
|
|
|
}
|
|
|
|
|
2013-09-01 02:44:55 +00:00
|
|
|
if (codecRegex.Groups["x264"].Success)
|
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.SDTV;
|
2013-09-01 02:44:55 +00:00
|
|
|
return result;
|
|
|
|
}
|
2014-05-19 19:14:41 +00:00
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (normalizedName.ContainsIgnoreCase("848x480"))
|
2014-05-19 19:14:41 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
|
|
|
if (normalizedName.Contains("dvd"))
|
2019-10-31 03:46:40 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.DVD;
|
|
|
|
}
|
2020-08-16 01:54:20 +00:00
|
|
|
else if (normalizedName.ContainsIgnoreCase("bluray"))
|
|
|
|
{
|
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.Quality = Quality.Bluray480p;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result.Quality = Quality.SDTV;
|
|
|
|
}
|
2014-05-19 19:14:41 +00:00
|
|
|
|
2020-08-16 01:54:20 +00:00
|
|
|
return result;
|
2014-05-19 19:14:41 +00:00
|
|
|
}
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (normalizedName.ContainsIgnoreCase("1280x720"))
|
2014-05-19 19:14:41 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (normalizedName.ContainsIgnoreCase("bluray"))
|
2014-05-19 19:14:41 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.Bluray720p;
|
2014-05-19 19:14:41 +00:00
|
|
|
}
|
2020-08-16 01:54:20 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
result.Quality = Quality.HDTV720p;
|
|
|
|
}
|
2019-10-31 03:46:40 +00:00
|
|
|
|
2020-08-16 01:54:20 +00:00
|
|
|
return result;
|
2014-05-19 19:14:41 +00:00
|
|
|
}
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (normalizedName.ContainsIgnoreCase("1920x1080"))
|
2014-05-19 19:14:41 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (normalizedName.ContainsIgnoreCase("bluray"))
|
2014-05-19 19:14:41 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.Bluray1080p;
|
2014-05-19 19:14:41 +00:00
|
|
|
}
|
2020-08-16 01:54:20 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
result.Quality = Quality.HDTV1080p;
|
|
|
|
}
|
2019-10-31 03:46:40 +00:00
|
|
|
|
2020-08-16 01:54:20 +00:00
|
|
|
return result;
|
2014-05-19 19:14:41 +00:00
|
|
|
}
|
2013-09-01 02:44:55 +00:00
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (normalizedName.ContainsIgnoreCase("bluray720p"))
|
2014-05-17 06:01:36 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.Bluray720p;
|
2020-08-16 01:54:20 +00:00
|
|
|
|
|
|
|
return result;
|
2014-05-17 06:01:36 +00:00
|
|
|
}
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (normalizedName.ContainsIgnoreCase("bluray1080p"))
|
2014-05-17 06:01:36 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.Bluray1080p;
|
2020-08-16 01:54:20 +00:00
|
|
|
|
|
|
|
return result;
|
2014-06-16 14:57:55 +00:00
|
|
|
}
|
|
|
|
|
2020-05-25 04:42:03 +00:00
|
|
|
if (normalizedName.ContainsIgnoreCase("bluray2160p"))
|
2013-09-01 02:44:55 +00:00
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
|
|
|
result.ResolutionDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = Quality.Bluray2160p;
|
2020-08-16 01:54:20 +00:00
|
|
|
|
|
|
|
return result;
|
2019-10-31 03:46:40 +00:00
|
|
|
}
|
2018-08-05 14:28:05 +00:00
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
var otherSourceMatch = OtherSourceMatch(normalizedName);
|
|
|
|
|
|
|
|
if (otherSourceMatch != Quality.Unknown)
|
|
|
|
{
|
2020-08-16 01:54:20 +00:00
|
|
|
result.SourceDetectionSource = QualityDetectionSource.Name;
|
2019-10-31 03:46:40 +00:00
|
|
|
result.Quality = otherSourceMatch;
|
2013-09-01 02:44:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2015-10-03 17:45:26 +00:00
|
|
|
private static Resolution ParseResolution(string name)
|
2013-09-01 02:44:55 +00:00
|
|
|
{
|
|
|
|
var match = ResolutionRegex.Match(name);
|
|
|
|
|
2021-01-12 18:37:40 +00:00
|
|
|
var matchimplied = ImpliedResolutionRegex.Match(name);
|
|
|
|
|
|
|
|
if (!match.Success & !matchimplied.Success)
|
2019-12-22 22:08:53 +00:00
|
|
|
{
|
|
|
|
return Resolution.Unknown;
|
|
|
|
}
|
|
|
|
|
2020-02-22 21:00:07 +00:00
|
|
|
if (match.Groups["R360p"].Success)
|
|
|
|
{
|
|
|
|
return Resolution.R360p;
|
|
|
|
}
|
|
|
|
|
2019-12-22 22:08:53 +00:00
|
|
|
if (match.Groups["R480p"].Success)
|
|
|
|
{
|
|
|
|
return Resolution.R480p;
|
|
|
|
}
|
|
|
|
|
2021-11-28 07:38:04 +00:00
|
|
|
if (match.Groups["R540p"].Success)
|
|
|
|
{
|
|
|
|
return Resolution.R540p;
|
|
|
|
}
|
|
|
|
|
2019-12-22 22:08:53 +00:00
|
|
|
if (match.Groups["R576p"].Success)
|
|
|
|
{
|
|
|
|
return Resolution.R576p;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (match.Groups["R720p"].Success)
|
|
|
|
{
|
|
|
|
return Resolution.R720p;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (match.Groups["R1080p"].Success)
|
|
|
|
{
|
|
|
|
return Resolution.R1080p;
|
|
|
|
}
|
|
|
|
|
2021-01-12 18:37:40 +00:00
|
|
|
if (match.Groups["R2160p"].Success || matchimplied.Groups["R2160p"].Success)
|
2019-12-22 22:08:53 +00:00
|
|
|
{
|
|
|
|
return Resolution.R2160p;
|
|
|
|
}
|
2013-09-01 02:44:55 +00:00
|
|
|
|
|
|
|
return Resolution.Unknown;
|
|
|
|
}
|
2014-06-16 14:57:55 +00:00
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
private static Quality OtherSourceMatch(string name)
|
2014-06-16 14:57:55 +00:00
|
|
|
{
|
|
|
|
var match = OtherSourceRegex.Match(name);
|
|
|
|
|
2019-12-22 22:08:53 +00:00
|
|
|
if (!match.Success)
|
|
|
|
{
|
|
|
|
return Quality.Unknown;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (match.Groups["sdtv"].Success)
|
|
|
|
{
|
|
|
|
return Quality.SDTV;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (match.Groups["hdtv"].Success)
|
|
|
|
{
|
|
|
|
return Quality.HDTV720p;
|
|
|
|
}
|
2014-06-16 14:57:55 +00:00
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
return Quality.Unknown;
|
2014-06-16 14:57:55 +00:00
|
|
|
}
|
2014-09-01 02:28:42 +00:00
|
|
|
|
2015-08-21 05:50:26 +00:00
|
|
|
private static QualityModel ParseQualityModifiers(string name, string normalizedName)
|
2014-09-01 02:28:42 +00:00
|
|
|
{
|
2019-10-31 03:46:40 +00:00
|
|
|
var result = new QualityModel { Quality = Quality.Unknown };
|
2014-09-01 02:28:42 +00:00
|
|
|
|
2023-05-02 00:48:24 +00:00
|
|
|
var versionRegexResult = VersionRegex.Match(normalizedName);
|
|
|
|
|
|
|
|
if (versionRegexResult.Success)
|
2014-09-01 02:28:42 +00:00
|
|
|
{
|
2023-05-02 00:48:24 +00:00
|
|
|
result.Revision.Version = Convert.ToInt32(versionRegexResult.Groups["version"].Value);
|
2020-11-12 02:37:45 +00:00
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
2014-09-01 02:28:42 +00:00
|
|
|
}
|
|
|
|
|
2023-05-02 00:48:24 +00:00
|
|
|
if (ProperRegex.IsMatch(normalizedName))
|
2019-07-13 03:56:58 +00:00
|
|
|
{
|
2023-05-02 00:48:24 +00:00
|
|
|
result.Revision.Version = versionRegexResult.Success ? Convert.ToInt32(versionRegexResult.Groups["version"].Value) + 1 : 2;
|
2020-11-12 02:37:45 +00:00
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
2019-07-13 03:56:58 +00:00
|
|
|
}
|
|
|
|
|
2023-05-02 00:48:24 +00:00
|
|
|
if (RepackRegex.IsMatch(normalizedName))
|
2014-09-01 02:28:42 +00:00
|
|
|
{
|
2023-05-02 00:48:24 +00:00
|
|
|
result.Revision.Version = versionRegexResult.Success ? Convert.ToInt32(versionRegexResult.Groups["version"].Value) + 1 : 2;
|
|
|
|
result.Revision.IsRepack = true;
|
2020-11-12 02:37:45 +00:00
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
2014-09-01 02:28:42 +00:00
|
|
|
}
|
|
|
|
|
2019-10-31 03:46:40 +00:00
|
|
|
// TODO: re-enable this when we have a reliable way to determine real
|
|
|
|
// TODO: Only treat it as a real if it comes AFTER the season/episode number
|
2015-08-21 05:50:26 +00:00
|
|
|
var realRegexResult = RealRegex.Matches(name);
|
|
|
|
|
|
|
|
if (realRegexResult.Count > 0)
|
|
|
|
{
|
|
|
|
result.Revision.Real = realRegexResult.Count;
|
2020-11-12 02:37:45 +00:00
|
|
|
result.RevisionDetectionSource = QualityDetectionSource.Name;
|
2015-08-21 05:50:26 +00:00
|
|
|
}
|
2014-09-01 02:28:42 +00:00
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
2013-09-01 02:44:55 +00:00
|
|
|
}
|
2019-10-31 03:46:40 +00:00
|
|
|
|
|
|
|
public enum Resolution
|
|
|
|
{
|
|
|
|
Unknown,
|
2020-02-22 21:00:07 +00:00
|
|
|
R360p = 360,
|
2019-10-31 03:46:40 +00:00
|
|
|
R480p = 480,
|
2021-11-28 07:38:04 +00:00
|
|
|
R540p = 540,
|
2019-10-31 03:46:40 +00:00
|
|
|
R576p = 576,
|
|
|
|
R720p = 720,
|
|
|
|
R1080p = 1080,
|
|
|
|
R2160p = 2160
|
|
|
|
}
|
2013-09-01 02:44:55 +00:00
|
|
|
}
|