mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-27 01:48:33 +03:00
Clear query cache for branding
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -44,6 +44,11 @@ export async function postClearCache(req: Request, res: Response): Promise<Respo
|
||||
hashedVideoID,
|
||||
service
|
||||
});
|
||||
QueryCacher.clearBrandingCache({
|
||||
videoID,
|
||||
hashedVideoID,
|
||||
service
|
||||
});
|
||||
return res.status(200).json({
|
||||
message: `Cache cleared on video ${videoID}`
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user