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

@ -314,7 +314,7 @@ namespace Emby.Drawing
=> _imageEncoder.GetImageSize(path); => _imageEncoder.GetImageSize(path);
/// <inheritdoc /> /// <inheritdoc />
public string GetImageHash(string path) public string GetImageBlurHash(string path)
=> _imageEncoder.GetImageHash(path); => _imageEncoder.GetImageHash(path);
/// <inheritdoc /> /// <inheritdoc />

View File

@ -1144,7 +1144,7 @@ namespace Emby.Server.Implementations.Data
const string delimeter = "*"; const string delimeter = "*";
var path = image.Path ?? string.Empty; var path = image.Path ?? string.Empty;
var hash = image.Hash ?? string.Empty; var hash = image.BlurHash ?? string.Empty;
return GetPathToSave(path) + return GetPathToSave(path) +
delimeter + delimeter +
@ -1195,7 +1195,7 @@ namespace Emby.Server.Implementations.Data
if (parts.Length >= 6) 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) if (options.EnableImages)
{ {
dto.ImageTags = new Dictionary<ImageType, string>(); dto.ImageTags = new Dictionary<ImageType, string>();
dto.ImageHashes = new Dictionary<string, string>(); dto.ImageBlurHashes = new Dictionary<string, string>();
// Prevent implicitly captured closure // Prevent implicitly captured closure
var currentItem = item; var currentItem = item;
@ -733,10 +733,10 @@ namespace Emby.Server.Implementations.Dto
dto.ImageTags[image.Type] = tag; dto.ImageTags[image.Type] = tag;
} }
var hash = image.Hash; var hash = image.BlurHash;
if (!string.IsNullOrEmpty(hash)) 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 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(); .ToList();
if (outdated.Count == 0) if (outdated.Count == 0)
{ {
@ -1842,7 +1842,7 @@ namespace Emby.Server.Implementations.Library
ImageDimensions size = _imageProcessor.GetImageDimensions(item, img); ImageDimensions size = _imageProcessor.GetImageDimensions(item, img);
img.Width = size.Width; img.Width = size.Width;
img.Height = size.Height; img.Height = size.Height;
img.Hash = _imageProcessor.GetImageHash(img.Path); img.BlurHash = _imageProcessor.GetImageBlurHash(img.Path);
}); });
_itemRepository.SaveImages(item); _itemRepository.SaveImages(item);

View File

@ -341,7 +341,7 @@ namespace MediaBrowser.Api.Images
var fileInfo = _fileSystem.GetFileInfo(info.Path); var fileInfo = _fileSystem.GetFileInfo(info.Path);
length = fileInfo.Length; length = fileInfo.Length;
blurhash = info.Hash; blurhash = info.BlurHash;
width = info.Width; width = info.Width;
height = info.Height; height = info.Height;

View File

@ -45,7 +45,7 @@ namespace MediaBrowser.Controller.Drawing
/// </summary> /// </summary>
/// <param name="path">Path to the image file.</param> /// <param name="path">Path to the image file.</param>
/// <returns>BlurHash</returns> /// <returns>BlurHash</returns>
String GetImageHash(string path); string GetImageBlurHash(string path);
/// <summary> /// <summary>
/// Gets the image cache tag. /// Gets the image cache tag.

View File

@ -2223,7 +2223,7 @@ namespace MediaBrowser.Controller.Entities
existingImage.DateModified = image.DateModified; existingImage.DateModified = image.DateModified;
existingImage.Width = image.Width; existingImage.Width = image.Width;
existingImage.Height = image.Height; existingImage.Height = image.Height;
existingImage.Hash = image.Hash; existingImage.BlurHash = image.BlurHash;
} }
else else
{ {

View File

@ -32,7 +32,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the blurhash. /// Gets or sets the blurhash.
/// </summary> /// </summary>
/// <value>The blurhash.</value> /// <value>The blurhash.</value>
public string Hash { get; set; } public string BlurHash { get; set; }
[JsonIgnore] [JsonIgnore]
public bool IsLocalFile => Path == null || !Path.StartsWith("http", StringComparison.OrdinalIgnoreCase); public bool IsLocalFile => Path == null || !Path.StartsWith("http", StringComparison.OrdinalIgnoreCase);

View File

@ -514,7 +514,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the blurhash for the image tags. /// Gets or sets the blurhash for the image tags.
/// </summary> /// </summary>
/// <value>The blurhashes.</value> /// <value>The blurhashes.</value>
public Dictionary<string, string> ImageHashes { get; set; } public Dictionary<string, string> ImageBlurHashes { get; set; }
/// <summary> /// <summary>
/// Gets or sets the series studio. /// Gets or sets the series studio.