1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00

Fixed: Don't handle images in metadata folder as Roksbox images

(cherry picked from commit 95a8f59a32d55550d5367f08a964859a97a0df44)
This commit is contained in:
Mark McDowall
2023-02-20 16:03:05 -08:00
committed by Bogdan
parent 239109e3dd
commit 77cde138dc
5 changed files with 108 additions and 4 deletions
@@ -87,9 +87,7 @@ namespace NzbDrone.Common.Extensions
public static string GetParentPath(this string childPath)
{
var cleanPath = OsInfo.IsWindows
? PARENT_PATH_END_SLASH_REGEX.Replace(childPath, "")
: childPath.TrimEnd(Path.DirectorySeparatorChar);
var cleanPath = childPath.GetCleanPath();
if (cleanPath.IsNullOrWhiteSpace())
{
@@ -99,6 +97,13 @@ namespace NzbDrone.Common.Extensions
return Directory.GetParent(cleanPath)?.FullName;
}
public static string GetParentName(this string childPath)
{
var cleanPath = childPath.GetCleanPath();
return Directory.GetParent(cleanPath)?.Name;
}
public static string GetCleanPath(this string path)
{
var cleanPath = OsInfo.IsWindows