Browse Source

Fix plugin old version cleanup

Odd Stråbø 4 years ago
parent
commit
f8dd50fc1a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Emby.Server.Implementations/ApplicationHost.cs

+ 2 - 1
Emby.Server.Implementations/ApplicationHost.cs

@@ -1070,7 +1070,6 @@ namespace Emby.Server.Implementations
                 if (!string.IsNullOrEmpty(lastName) && cleanup)
                 {
                     // Attempt a cleanup of old folders.
-                    versions.RemoveAt(x);
                     try
                     {
                         Logger.LogDebug("Deleting {Path}", versions[x].Path);
@@ -1080,6 +1079,8 @@ namespace Emby.Server.Implementations
                     {
                         Logger.LogWarning(e, "Unable to delete {Path}", versions[x].Path);
                     }
+
+                    versions.RemoveAt(x);
                 }
             }