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);
/// <inheritdoc />
public string GetImageHash(string path)
public string GetImageBlurHash(string path)
=> _imageEncoder.GetImageHash(path);
/// <inheritdoc />

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);

View File

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

View File

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

View File

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

View File

@ -32,7 +32,7 @@ namespace MediaBrowser.Controller.Entities
/// Gets or sets the blurhash.
/// </summary>
/// <value>The blurhash.</value>
public string Hash { get; set; }
public string BlurHash { get; set; }
[JsonIgnore]
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.
/// </summary>
/// <value>The blurhashes.</value>
public Dictionary<string, string> ImageHashes { get; set; }
public Dictionary<string, string> ImageBlurHashes { get; set; }
/// <summary>
/// Gets or sets the series studio.