|
|
|
@ -153,13 +153,16 @@ public class DeleteOrphanedArtworkHandler( |
|
|
|
{ |
|
|
|
{ |
|
|
|
try |
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
// don't delete direct children of artwork cache folder
|
|
|
|
// don't delete artwork cache folder or its direct children
|
|
|
|
|
|
|
|
if (path != FileSystemLayout.ArtworkCacheFolder) |
|
|
|
|
|
|
|
{ |
|
|
|
var parent = fileSystem.Directory.GetParent(path); |
|
|
|
var parent = fileSystem.Directory.GetParent(path); |
|
|
|
if (parent != null && parent.FullName != FileSystemLayout.ArtworkCacheFolder) |
|
|
|
if (parent?.FullName != FileSystemLayout.ArtworkCacheFolder) |
|
|
|
{ |
|
|
|
{ |
|
|
|
fileSystem.Directory.Delete(path); |
|
|
|
fileSystem.Directory.Delete(path); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
{ |
|
|
|
logger.LogWarning(ex, "Could not delete empty cache folder {Folder}", path); |
|
|
|
logger.LogWarning(ex, "Could not delete empty cache folder {Folder}", path); |
|
|
|
|