mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 19:47:00 +03:00
Remove hash from result to save bandwidth
This commit is contained in:
@@ -81,7 +81,6 @@ export async function getVideoBrandingByHash(videoHashPrefix: VideoIDHash, servi
|
|||||||
const dbResult: Record<VideoID, BrandingHashDBResult> = {};
|
const dbResult: Record<VideoID, BrandingHashDBResult> = {};
|
||||||
const initResult = (submission: BrandingDBSubmission) => {
|
const initResult = (submission: BrandingDBSubmission) => {
|
||||||
dbResult[submission.videoID] = dbResult[submission.videoID] || {
|
dbResult[submission.videoID] = dbResult[submission.videoID] || {
|
||||||
hash: submission.hashedVideoID,
|
|
||||||
branding: {
|
branding: {
|
||||||
titles: [],
|
titles: [],
|
||||||
thumbnails: []
|
thumbnails: []
|
||||||
@@ -110,7 +109,6 @@ export async function getVideoBrandingByHash(videoHashPrefix: VideoIDHash, servi
|
|||||||
await Promise.all(Object.keys(branding).map(async (key) => {
|
await Promise.all(Object.keys(branding).map(async (key) => {
|
||||||
const castedKey = key as VideoID;
|
const castedKey = key as VideoID;
|
||||||
processedResult[castedKey] = {
|
processedResult[castedKey] = {
|
||||||
hash: branding[castedKey].hash,
|
|
||||||
branding: await filterAndSortBranding(branding[castedKey].branding.titles, branding[castedKey].branding.thumbnails, ip, cache)
|
branding: await filterAndSortBranding(branding[castedKey].branding.titles, branding[castedKey].branding.thumbnails, ip, cache)
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ export interface BrandingResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface BrandingHashDBResult {
|
export interface BrandingHashDBResult {
|
||||||
hash: VideoIDHash;
|
|
||||||
branding: {
|
branding: {
|
||||||
titles: TitleDBResult[],
|
titles: TitleDBResult[],
|
||||||
thumbnails: ThumbnailDBResult[]
|
thumbnails: ThumbnailDBResult[]
|
||||||
@@ -53,6 +52,5 @@ export interface BrandingHashDBResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface BrandingHashResult {
|
export interface BrandingHashResult {
|
||||||
hash: VideoIDHash;
|
|
||||||
branding: BrandingResult;
|
branding: BrandingResult;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user