Removed RemoveOldPlugins configuration flag (#13102)

This commit is contained in:
RealGreenDragon 2024-12-02 01:09:30 +01:00 committed by GitHub
parent 06923cbf2b
commit f1e020c0b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 25 deletions

View file

@ -785,30 +785,27 @@ namespace Emby.Server.Implementations.Plugins
var cleaned = false; var cleaned = false;
var path = entry.Path; var path = entry.Path;
if (_config.RemoveOldPlugins) // Attempt a cleanup of old folders.
try
{ {
// Attempt a cleanup of old folders. _logger.LogDebug("Deleting {Path}", path);
try Directory.Delete(path, true);
{ cleaned = true;
_logger.LogDebug("Deleting {Path}", path); }
Directory.Delete(path, true);
cleaned = true;
}
#pragma warning disable CA1031 // Do not catch general exception types #pragma warning disable CA1031 // Do not catch general exception types
catch (Exception e) catch (Exception e)
#pragma warning restore CA1031 // Do not catch general exception types #pragma warning restore CA1031 // Do not catch general exception types
{ {
_logger.LogWarning(e, "Unable to delete {Path}", path); _logger.LogWarning(e, "Unable to delete {Path}", path);
} }
if (cleaned) if (cleaned)
{ {
versions.RemoveAt(x); versions.RemoveAt(x);
} }
else else
{ {
ChangePluginState(entry, PluginStatus.Deleted); ChangePluginState(entry, PluginStatus.Deleted);
}
} }
} }

View file

@ -243,11 +243,6 @@ public class ServerConfiguration : BaseApplicationConfiguration
/// </summary> /// </summary>
public int LibraryMetadataRefreshConcurrency { get; set; } public int LibraryMetadataRefreshConcurrency { get; set; }
/// <summary>
/// Gets or sets a value indicating whether older plugins should automatically be deleted from the plugin folder.
/// </summary>
public bool RemoveOldPlugins { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether clients should be allowed to upload logs. /// Gets or sets a value indicating whether clients should be allowed to upload logs.
/// </summary> /// </summary>