Rename Hash to BlurHash in all properties and methods for clarity

This commit is contained in:
Vasily
2020-05-21 01:43:19 +03:00
parent 8b517e9bef
commit 1f83a21288
9 changed files with 13 additions and 13 deletions

View File

@@ -1144,7 +1144,7 @@ namespace Emby.Server.Implementations.Data
const string delimeter = "*";
var path = image.Path ?? string.Empty;
var hash = image.Hash ?? string.Empty;
var hash = image.BlurHash ?? string.Empty;
return GetPathToSave(path) +
delimeter +
@@ -1195,7 +1195,7 @@ namespace Emby.Server.Implementations.Data
if (parts.Length >= 6)
{
image.Hash = parts[5].Replace('/', '*').Replace('\\', '|');
image.BlurHash = parts[5].Replace('/', '*').Replace('\\', '|');
}
}

View File

@@ -718,7 +718,7 @@ namespace Emby.Server.Implementations.Dto
if (options.EnableImages)
{
dto.ImageTags = new Dictionary<ImageType, string>();
dto.ImageHashes = new Dictionary<string, string>();
dto.ImageBlurHashes = new Dictionary<string, string>();
// Prevent implicitly captured closure
var currentItem = item;
@@ -733,10 +733,10 @@ namespace Emby.Server.Implementations.Dto
dto.ImageTags[image.Type] = tag;
}
var hash = image.Hash;
var hash = image.BlurHash;
if (!string.IsNullOrEmpty(hash))
{
dto.ImageHashes[tag] = image.Hash;
dto.ImageBlurHashes[tag] = image.BlurHash;
}
}
}

View File

@@ -1829,7 +1829,7 @@ namespace Emby.Server.Implementations.Library
}
var outdated = item.ImageInfos
.Where(i => (i.IsLocalFile && (i.Width == 0 || i.Height == 0 || string.IsNullOrEmpty(i.Hash))))
.Where(i => (i.IsLocalFile && (i.Width == 0 || i.Height == 0 || string.IsNullOrEmpty(i.BlurHash))))
.ToList();
if (outdated.Count == 0)
{
@@ -1842,7 +1842,7 @@ namespace Emby.Server.Implementations.Library
ImageDimensions size = _imageProcessor.GetImageDimensions(item, img);
img.Width = size.Width;
img.Height = size.Height;
img.Hash = _imageProcessor.GetImageHash(img.Path);
img.BlurHash = _imageProcessor.GetImageBlurHash(img.Path);
});
_itemRepository.SaveImages(item);