fix for lint

This commit is contained in:
syuilo
2021-11-13 19:10:14 +09:00
parent 01afdc410e
commit 8b7f5be878
12 changed files with 581 additions and 574 deletions

View File

@@ -54,7 +54,7 @@ export async function populateEmoji(emojiName: string, noteUserHost: string | nu
const queryOrNull = async () => (await Emojis.findOne({
name,
host
host,
})) || null;
const emoji = await cache.fetch(`${name} ${host}`, queryOrNull);
@@ -62,7 +62,7 @@ export async function populateEmoji(emojiName: string, noteUserHost: string | nu
if (emoji == null) return null;
const isLocal = emoji.host == null;
const url = isLocal ? emoji.url : `${config.url}/proxy/image.png?${query({url: emoji.url})}`;
const url = isLocal ? emoji.url : `${config.url}/proxy/image.png?${query({ url: emoji.url })}`;
return {
name: emojiName,
@@ -111,12 +111,12 @@ export async function prefetchEmojis(emojis: { name: string; host: string | null
for (const host of hosts) {
emojisQuery.push({
name: In(notCachedEmojis.filter(e => e.host === host).map(e => e.name)),
host: host
host: host,
});
}
const _emojis = emojisQuery.length > 0 ? await Emojis.find({
where: emojisQuery,
select: ['name', 'host', 'url']
select: ['name', 'host', 'url'],
}) : [];
for (const emoji of _emojis) {
cache.set(`${emoji.name} ${emoji.host}`, emoji);