mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-08-11 09:13:54 -04:00
Always save images (#14600)
This commit is contained in:
parent
877899dcc2
commit
0650666497
@ -1981,8 +1981,6 @@ namespace Emby.Server.Implementations.Library
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var anyChange = false;
|
|
||||||
|
|
||||||
foreach (var img in outdated)
|
foreach (var img in outdated)
|
||||||
{
|
{
|
||||||
var image = img;
|
var image = img;
|
||||||
@ -2014,7 +2012,6 @@ namespace Emby.Server.Implementations.Library
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
size = _imageProcessor.GetImageDimensions(item, image);
|
size = _imageProcessor.GetImageDimensions(item, image);
|
||||||
anyChange = image.Width != size.Width || image.Height != size.Height;
|
|
||||||
image.Width = size.Width;
|
image.Width = size.Width;
|
||||||
image.Height = size.Height;
|
image.Height = size.Height;
|
||||||
}
|
}
|
||||||
@ -2022,7 +2019,6 @@ namespace Emby.Server.Implementations.Library
|
|||||||
{
|
{
|
||||||
_logger.LogError(ex, "Cannot get image dimensions for {ImagePath}", image.Path);
|
_logger.LogError(ex, "Cannot get image dimensions for {ImagePath}", image.Path);
|
||||||
size = default;
|
size = default;
|
||||||
anyChange = image.Width != size.Width || image.Height != size.Height;
|
|
||||||
image.Width = 0;
|
image.Width = 0;
|
||||||
image.Height = 0;
|
image.Height = 0;
|
||||||
}
|
}
|
||||||
@ -2030,20 +2026,17 @@ namespace Emby.Server.Implementations.Library
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var blurhash = _imageProcessor.GetImageBlurHash(image.Path, size);
|
var blurhash = _imageProcessor.GetImageBlurHash(image.Path, size);
|
||||||
anyChange = anyChange || !blurhash.Equals(image.BlurHash, StringComparison.Ordinal);
|
|
||||||
image.BlurHash = blurhash;
|
image.BlurHash = blurhash;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Cannot compute blurhash for {ImagePath}", image.Path);
|
_logger.LogError(ex, "Cannot compute blurhash for {ImagePath}", image.Path);
|
||||||
anyChange = anyChange || !string.IsNullOrEmpty(image.BlurHash);
|
|
||||||
image.BlurHash = string.Empty;
|
image.BlurHash = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var modifiedDate = _fileSystem.GetLastWriteTimeUtc(image.Path);
|
var modifiedDate = _fileSystem.GetLastWriteTimeUtc(image.Path);
|
||||||
anyChange = anyChange || modifiedDate != image.DateModified;
|
|
||||||
image.DateModified = modifiedDate;
|
image.DateModified = modifiedDate;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -2052,10 +2045,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (anyChange)
|
_itemRepository.SaveImages(item);
|
||||||
{
|
|
||||||
_itemRepository.SaveImages(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
RegisterItem(item);
|
RegisterItem(item);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user