feat: Blurhash integration

Resolve #6559
This commit is contained in:
syuilo
2020-07-19 00:24:07 +09:00
parent 705d40ab37
commit 3f71b14637
22 changed files with 249 additions and 214 deletions

View File

@ -327,7 +327,6 @@ export default async function(
const properties: {
width?: number;
height?: number;
avgColor?: string;
} = {};
if (info.width) {
@ -335,10 +334,6 @@ export default async function(
properties['height'] = info.height;
}
if (info.avgColor) {
properties['avgColor'] = `rgb(${info.avgColor.join(',')})`;
}
const profile = user ? await UserProfiles.findOne(user.id) : null;
const folder = await fetchFolder();
@ -351,6 +346,7 @@ export default async function(
file.folderId = folder !== null ? folder.id : null;
file.comment = comment;
file.properties = properties;
file.blurhash = info.blurhash || null;
file.isLink = isLink;
file.isSensitive = user
? Users.isLocalUser(user) && profile!.alwaysMarkNsfw ? true :