The Free Software Media System - Server Backend & API
Make blurhash be computed during regular scans if it was not already computed
Vasily3fb4c1356c22
diff --git a/Jellyfin.Drawing.Skia/SkiaEncoder.cs b/Jellyfin.Drawing.Skia/SkiaEncoder.csindex 99091ea57e..7ab0a54dfd 100644--- a/Jellyfin.Drawing.Skia/SkiaEncoder.cs+++ b/Jellyfin.Drawing.Skia/SkiaEncoder.cs@@ -246,6 +246,8 @@ namespace Jellyfin.Drawing.Skiathrow new FileNotFoundException("File not found", path);}+ // Use 4 vertical and 4 horizontal components of DCT of the image.+ // See more at https://github.com/woltapp/blurhash/#how-do-i-pick-the-number-of-x-and-y-componentsreturn BlurHashEncoder.Encode(4, 4, path);}diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.csindex e5f6ea09d6..035ab1dd94 100644--- a/MediaBrowser.Controller/Entities/BaseItem.cs+++ b/MediaBrowser.Controller/Entities/BaseItem.cs@@ -1374,6 +1374,7 @@ namespace MediaBrowser.Controller.Entitiesnew List<FileSystemMetadata>();var ownedItemsChanged = await RefreshedOwnedItems(options, files, cancellationToken).ConfigureAwait(false);+ LibraryManager.UpdateImages(this); // ensure all image properties in DB are freshif (ownedItemsChanged){diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.csindex a468e0c35a..29040f92e6 100644--- a/MediaBrowser.Controller/Entities/Folder.cs+++ b/MediaBrowser.Controller/Entities/Folder.cs@@ -341,6 +341,11 @@ namespace MediaBrowser.Controller.Entities{currentChild.UpdateToRepository(ItemUpdateType.MetadataImport, cancellationToken);}+ else+ {+ // metadata is up-to-date; make sure DB has correct images dimensions and hash+ LibraryManager.UpdateImages(currentChild);+ }continue;}