Fixed: Exception when parsing Quality in release title with colon
This commit is contained in:
parent
4a5bca860a
commit
f3101a1db2
|
@ -57,6 +57,17 @@ namespace NzbDrone.Common.Extensions
|
||||||
return string.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), comparison.Value);
|
return string.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), comparison.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetPathExtension(this string path)
|
||||||
|
{
|
||||||
|
var idx = path.LastIndexOf('.');
|
||||||
|
if (idx == -1 || idx == path.Length - 1)
|
||||||
|
{
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
return path.Substring(idx);
|
||||||
|
}
|
||||||
|
|
||||||
public static string GetRelativePath(this string parentPath, string childPath)
|
public static string GetRelativePath(this string parentPath, string childPath)
|
||||||
{
|
{
|
||||||
if (!parentPath.IsParentPath(childPath))
|
if (!parentPath.IsParentPath(childPath))
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Common.Instrumentation;
|
using NzbDrone.Common.Instrumentation;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
|
@ -343,7 +344,7 @@ namespace NzbDrone.Core.Parser
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var quality = MediaFileExtensions.GetQualityForExtension(Path.GetExtension(name));
|
var quality = MediaFileExtensions.GetQualityForExtension(name.GetPathExtension());
|
||||||
|
|
||||||
if (quality != Quality.Unknown)
|
if (quality != Quality.Unknown)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue