Remove DynamicImageResponse local image after saved to metadata folder

Previously, local images provided by DynamicImageResponse were never cleaned up until the server was restarted. This issue has become more severe in 10.10, as the default is now set to use the system's native temp folder, which might be a RAM backed tmpfs. This behavior could lead to resource starvation for long-running servers performing multiple library scans.

Metadata plugins prefer the old behavior should do its own backup.
This commit is contained in:
gnattu 2024-11-02 17:15:00 +08:00
parent 3592c629e7
commit 74d2c2addf

View file

@ -232,6 +232,8 @@ namespace MediaBrowser.Providers.Manager
var stream = AsyncFile.OpenRead(response.Path);
await _providerManager.SaveImage(item, stream, mimeType, imageType, null, cancellationToken).ConfigureAwait(false);
File.Delete(response.Path);
}
}