mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 14:37:17 +03:00
Fix video branding not being awaited
This commit is contained in:
@@ -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>> {
|
||||||
|
|||||||
Reference in New Issue
Block a user