aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/LibraryManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-18 03:32:17 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-02-18 03:32:17 -0500
commit6091e00e180b9b859de99c72b23dc155f284f516 (patch)
treed59db82f7dadc0302cc20b8165036369cd25f41a /Emby.Server.Implementations/Library/LibraryManager.cs
parent36f8eb1149e821de46b1ee15dcd1990c6a378ca9 (diff)
clean related files when deleting items
Diffstat (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs')
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 879735ccb..56bffc233 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -409,17 +409,17 @@ namespace Emby.Server.Implementations.Library
if (options.DeleteFileLocation && locationType != LocationType.Remote && locationType != LocationType.Virtual)
{
- foreach (var path in item.GetDeletePaths().ToList())
+ foreach (var fileSystemInfo in item.GetDeletePaths().ToList())
{
- if (_fileSystem.DirectoryExists(path))
+ if (fileSystemInfo.IsDirectory)
{
- _logger.Debug("Deleting path {0}", path);
- _fileSystem.DeleteDirectory(path, true);
+ _logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
+ _fileSystem.DeleteDirectory(fileSystemInfo.FullName, true);
}
- else if (_fileSystem.FileExists(path))
+ else
{
- _logger.Debug("Deleting path {0}", path);
- _fileSystem.DeleteFile(path);
+ _logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
+ _fileSystem.DeleteFile(fileSystemInfo.FullName);
}
}