From 0b5d4ce3f839118a0a5903ec278321ecfecf1c32 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 11 Jan 2017 12:56:26 -0500 Subject: fix live tv folders being created in a loop --- Emby.Common.Implementations/IO/ManagedFileSystem.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Emby.Common.Implementations/IO/ManagedFileSystem.cs') diff --git a/Emby.Common.Implementations/IO/ManagedFileSystem.cs b/Emby.Common.Implementations/IO/ManagedFileSystem.cs index 78070a5d9..72b9d55eb 100644 --- a/Emby.Common.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Common.Implementations/IO/ManagedFileSystem.cs @@ -499,6 +499,24 @@ namespace Emby.Common.Implementations.IO CopyFile(temp1, file2, true); } + public bool AreEqual(string path1, string path2) + { + if (path1 == null && path2 == null) + { + return true; + } + + if (path1 == null || path2 == null) + { + return false; + } + + path1 = path1.TrimEnd(DirectorySeparatorChar); + path2 = path2.TrimEnd(DirectorySeparatorChar); + + return string.Equals(path1, path2, StringComparison.OrdinalIgnoreCase); + } + public bool ContainsSubPath(string parentPath, string path) { if (string.IsNullOrEmpty(parentPath)) -- cgit v1.2.3