The Free Software Media System - Server Backend & API
fix current image deletion in image saver
Luke Pulverentif593230e446b
diff --git a/MediaBrowser.Providers/Manager/ImageSaver.cs b/MediaBrowser.Providers/Manager/ImageSaver.csindex 465677efb6..3de3305578 100644--- a/MediaBrowser.Providers/Manager/ImageSaver.cs+++ b/MediaBrowser.Providers/Manager/ImageSaver.cs@@ -133,6 +133,9 @@ namespace MediaBrowser.Providers.Managersource = memoryStream;var currentImage = GetCurrentImage(item, type, index);+ var currentImageIsLocalFile = currentImage != null && currentImage.IsLocalFile;+ var currentImagePath = currentImage == null ? null : currentImage.Path;+var savedPaths = new List<string>();using (source)@@ -157,9 +160,9 @@ namespace MediaBrowser.Providers.ManagerSetImagePath(item, type, imageIndex, savedPaths[0]);// Delete the current path- if (currentImage != null && currentImage.IsLocalFile && !savedPaths.Contains(currentImage.Path, StringComparer.OrdinalIgnoreCase))+ if (currentImageIsLocalFile && !savedPaths.Contains(currentImagePath, StringComparer.OrdinalIgnoreCase)){- var currentPath = currentImage.Path;+ var currentPath = currentImagePath;_logger.Debug("Deleting previous image {0}", currentPath);