Fix video branding not being awaited

This commit is contained in:
Ajay
2023-02-18 02:33:22 -05:00
parent 46c372a764
commit 19ebca86c9

View File

@@ -38,10 +38,9 @@ export async function getVideoBranding(videoID: VideoID, service: Service, ip: I
{ useReplica: true } { useReplica: true }
) as Promise<ThumbnailDBResult[]>; ) as Promise<ThumbnailDBResult[]>;
// eslint-disable-next-line require-await
const getBranding = async () => ({ const getBranding = async () => ({
titles: getTitles(), titles: await getTitles(),
thumbnails: getThumbnails() thumbnails: await getThumbnails()
}); });
const branding = await QueryCacher.get(getBranding, brandingKey(videoID, service)); const branding = await QueryCacher.get(getBranding, brandingKey(videoID, service));
@@ -50,7 +49,7 @@ export async function getVideoBranding(videoID: VideoID, service: Service, ip: I
currentIP: null as Promise<HashedIP> | null currentIP: null as Promise<HashedIP> | null
}; };
return filterAndSortBranding(await branding.titles, await branding.thumbnails, ip, cache); return filterAndSortBranding(branding.titles, branding.thumbnails, ip, cache);
} }
export async function getVideoBrandingByHash(videoHashPrefix: VideoIDHash, service: Service, ip: IPAddress): Promise<Record<VideoID, BrandingResult>> { export async function getVideoBrandingByHash(videoHashPrefix: VideoIDHash, service: Service, ip: IPAddress): Promise<Record<VideoID, BrandingResult>> {