diff --git a/Shokofin/Resolvers/VirtualFileSystemService.cs b/Shokofin/Resolvers/VirtualFileSystemService.cs index 7978461c..14168ed6 100644 --- a/Shokofin/Resolvers/VirtualFileSystemService.cs +++ b/Shokofin/Resolvers/VirtualFileSystemService.cs @@ -1001,6 +1001,12 @@ private List FindSubtitlesForPath(string sourcePath) private LinkGenerationResult CleanupStructure(string vfsPath, string directoryToClean, IReadOnlyList allKnownPaths, bool preview = false) { + if (!FileSystem.DirectoryExists(directoryToClean)) { + if (!preview) + Logger.LogDebug("Skipped cleaning up folder because it does not exist: {Path}", directoryToClean); + return new(); + } + if (!preview) Logger.LogDebug("Looking for files to remove in folder at {Path}", directoryToClean); var start = DateTime.Now;