When writing an image to the disk, we use the completion of the async task as a signal indicating the completion of a write operation. However, this approach may not be entirely accurate, as the operating system can optimize IO operations by writing data to an intermediate cache instead of directly to the disk before completing the operation. This optimization can lead to a data race for our scanner, as subsequent tasks such as blurhash computation may attempt to read a file that has not yet been flushed from the volatile cache. Consequently, the data within the file becomes invalid, causing the blurhash computation task to fail.
Use WriteThrough mode to ensure the data is actual on disk before return to resolve this issue.
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.
Set ProductionLocations instead of Tags
Original-merge: 279cba008b
Merged-by: crobibero <cody@robibe.ro>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
Fallback to local dir when saving to media dir fails
Original-merge: f41efb3b2c
Merged-by: joshuaboniface <joshua@boniface.me>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
Fix identify over NFO and replace all when NFO saving enabled
Original-merge: bfcc09db8a
Merged-by: joshuaboniface <joshua@boniface.me>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
This is an alternate approach which is more proper, but changes all parts that uses/overrides the original ValidateChildren method
Signed-off-by: gnattu <gnattuoc@me.com>
```
System.ArgumentException: Guid can't be empty (Parameter 'id')
at Emby.Server.Implementations.Library.LibraryManager.GetItemById(Guid id) in /home/loma/dev/jellyfin/Emby.Server.Implementations/Library/LibraryManager.cs:line 1224
at MediaBrowser.Providers.Manager.ProviderManager.StartProcessingRefreshQueue() in /home/loma/dev/jellyfin/MediaBrowser.Providers/Manager/ProviderManager.cs:line 983
```