mirror of
https://github.com/sphildreth/roadie
synced 2024-11-29 23:50:21 +00:00
48 lines
No EOL
1,005 B
C#
48 lines
No EOL
1,005 B
C#
using Microsoft.Net.Http.Headers;
|
|
using Roadie.Library.Imaging;
|
|
using Roadie.Library.Utility;
|
|
using System;
|
|
using System.Linq;
|
|
|
|
namespace Roadie.Library.Data
|
|
{
|
|
public partial class Image
|
|
{
|
|
public static string CacheRegionUrn(Guid Id)
|
|
{
|
|
return string.Format("urn:image:{0}", Id);
|
|
}
|
|
|
|
public static string CacheUrn(Guid Id)
|
|
{
|
|
return $"urn:image_by_id:{ Id }";
|
|
}
|
|
|
|
public string CacheKey
|
|
{
|
|
get
|
|
{
|
|
return Artist.CacheUrn(this.RoadieId);
|
|
}
|
|
}
|
|
|
|
public string CacheRegion
|
|
{
|
|
get
|
|
{
|
|
return Image.CacheRegionUrn(this.RoadieId);
|
|
}
|
|
}
|
|
|
|
public string GenerateSignature()
|
|
{
|
|
if (this.Bytes == null || !this.Bytes.Any())
|
|
{
|
|
return null;
|
|
}
|
|
return ImageHasher.AverageHash(this.Bytes).ToString();
|
|
}
|
|
|
|
|
|
}
|
|
} |