diff --git a/src/routes/postBranding.ts b/src/routes/postBranding.ts index ba5a159..8307615 100644 --- a/src/routes/postBranding.ts +++ b/src/routes/postBranding.ts @@ -11,6 +11,7 @@ import { getService } from "../utils/getService"; import { isUserVIP } from "../utils/isUserVIP"; import { Logger } from "../utils/logger"; import crypto from "crypto"; +import { QueryCacher } from "../utils/queryCacher"; enum BrandingType { Title, @@ -96,6 +97,7 @@ export async function postBranding(req: Request, res: Response) { } })()]); + QueryCacher.clearBrandingCache({ videoID, hashedVideoID, service }); res.status(200).send("OK"); } catch (e) { Logger.error(e as string); diff --git a/src/routes/postClearCache.ts b/src/routes/postClearCache.ts index 0a4d381..29979c0 100644 --- a/src/routes/postClearCache.ts +++ b/src/routes/postClearCache.ts @@ -44,6 +44,11 @@ export async function postClearCache(req: Request, res: Response): Promise Logger.error(err)); + redis.del(brandingKey(videoInfo.videoID, videoInfo.service)).catch((err) => Logger.error(err)); + } +} + async function getKeyLastModified(key: string): Promise { if (!config.redis?.enabled) return Promise.reject("ETag - Redis not enabled"); return await redis.ttl(key) @@ -112,6 +119,7 @@ export const QueryCacher = { get, getAndSplit, clearSegmentCache, + clearBrandingCache, getKeyLastModified, clearRatingCache, clearFeatureCache,