Explorar o código

Merge pull request #4516 from oddstr13/fix-plugin-cleanup

Fix plugin old version cleanup
Claus Vium %!s(int64=4) %!d(string=hai) anos
pai
achega
456ae32331
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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)
                 if (!string.IsNullOrEmpty(lastName) && cleanup)
                 {
                 {
                     // Attempt a cleanup of old folders.
                     // Attempt a cleanup of old folders.
-                    versions.RemoveAt(x);
                     try
                     try
                     {
                     {
                         Logger.LogDebug("Deleting {Path}", versions[x].Path);
                         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);
                         Logger.LogWarning(e, "Unable to delete {Path}", versions[x].Path);
                     }
                     }
+
+                    versions.RemoveAt(x);
                 }
                 }
             }
             }