From fd038891fb519c0923eabb2f63e5d741ae32d507 Mon Sep 17 00:00:00 2001 From: markus101 Date: Sun, 6 Mar 2011 22:09:22 -0800 Subject: [PATCH] Added parser for parsing the Quality of an Episode sent to SAB (So we get the proper quality) --- NzbDrone.Core/Parser.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/NzbDrone.Core/Parser.cs b/NzbDrone.Core/Parser.cs index 42c07c880..fa78c1fd3 100644 --- a/NzbDrone.Core/Parser.cs +++ b/NzbDrone.Core/Parser.cs @@ -171,6 +171,32 @@ namespace NzbDrone.Core return result; } + internal static QualityTypes ParseDroneQuality(string name) + { + var result = QualityTypes.Unknown; + + if (name.Contains("[TV]")) + return QualityTypes.TV; + + if (name.Contains("[DVD]")) + return QualityTypes.DVD; + + if (name.Contains("[BDRip]")) + return QualityTypes.BDRip; + + if (name.Contains("[HDTV]")) + return QualityTypes.HDTV; + + if (name.Contains("[WEBDL]")) + return QualityTypes.WEBDL; + + if (name.Contains("[Bluray]")) + return QualityTypes.Bluray; + + //If it's unknown let the "regular" quality parse have a go + return ParseQuality(name); + } + /// /// Normalizes the title. removing all non-word characters as well as common tokens /// such as 'the' and 'and'