mirror of https://github.com/lidarr/Lidarr
Fixed: Exception when parsing Quality in release title with colon
This commit is contained in:
parent
724ece54c8
commit
4d90daebf1
|
@ -71,6 +71,17 @@ namespace NzbDrone.Common.Extensions
|
|||
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)
|
||||
{
|
||||
if (!parentPath.IsParentPath(childPath))
|
||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Instrumentation;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
|
@ -232,7 +233,7 @@ namespace NzbDrone.Core.Parser
|
|||
{
|
||||
try
|
||||
{
|
||||
result.Quality = MediaFileExtensions.GetQualityForExtension(Path.GetExtension(name));
|
||||
result.Quality = MediaFileExtensions.GetQualityForExtension(name.GetPathExtension());
|
||||
result.QualityDetectionSource = QualityDetectionSource.Extension;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
|
|
Loading…
Reference in New Issue