rename clearSegmentCache

This commit is contained in:
Michael C
2021-11-15 01:48:14 -05:00
parent b9ebd00365
commit 03c95ca158
5 changed files with 7 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ export async function postClearCache(req: Request, res: Response): Promise<Respo
}
try {
QueryCacher.clearVideoCache({
QueryCacher.clearSegmentCache({
videoID,
hashedVideoID,
service

View File

@@ -31,7 +31,7 @@ export async function postPurgeAllSegments(req: Request, res: Response): Promise
await db.prepare("run", `UPDATE "sponsorTimes" SET "hidden" = 1 WHERE "videoID" = ?`, [videoID]);
const hashedVideoID: VideoIDHash = getHash(videoID, 1);
QueryCacher.clearVideoCache({
QueryCacher.clearSegmentCache({
videoID,
hashedVideoID,
service

View File

@@ -657,7 +657,7 @@ export async function postSkipSegments(req: Request, res: Response): Promise<Res
videoID, apiVideoInfo?.data?.authorId || "", apiVideoInfo?.data?.title || "", apiVideoInfo?.data?.published || 0, apiVideoInfo?.data?.genreUrl || "", videoID]);
// Clear redis cache for this video
QueryCacher.clearVideoCache({
QueryCacher.clearSegmentCache({
videoID,
hashedVideoID,
service,

View File

@@ -68,7 +68,7 @@ export async function shadowBanUser(req: Request, res: Response): Promise<Respon
// collect list for unshadowbanning
(await db.prepare("all", `SELECT "videoID", "hashedVideoID", "service", "votes", "views", "userID" FROM "sponsorTimes" WHERE "UUID" = ? AND "shadowHidden" = 1 AND "category" in (${categories.map((c) => `'${c}'`).join(",")})`, [UUID]))
.forEach((videoInfo: {category: Category, videoID: VideoID, hashedVideoID: VideoIDHash, service: Service, userID: UserID}) => {
QueryCacher.clearVideoCache(videoInfo);
QueryCacher.clearSegmentCache(videoInfo);
}
);
@@ -125,6 +125,6 @@ async function unHideSubmissions(categories: string[], userID: UserID) {
// clear cache for all old videos
(await db.prepare("all", `SELECT "videoID", "hashedVideoID", "service", "votes", "views" FROM "sponsorTimes" WHERE "userID" = ?`, [userID]))
.forEach((videoInfo: { category: Category; videoID: VideoID; hashedVideoID: VideoIDHash; service: Service; userID: UserID; }) => {
QueryCacher.clearVideoCache(videoInfo);
QueryCacher.clearSegmentCache(videoInfo);
});
}

View File

@@ -267,7 +267,7 @@ async function categoryVote(UUID: SegmentUUID, userID: UserID, isVIP: boolean, i
}
}
QueryCacher.clearVideoCache(videoInfo);
QueryCacher.clearSegmentCache(videoInfo);
return res.sendStatus(finalResponse.finalStatus);
}
@@ -473,7 +473,7 @@ export async function voteOnSponsorTime(req: Request, res: Response): Promise<Re
await db.prepare("run", 'UPDATE "sponsorTimes" SET locked = 0 WHERE "UUID" = ?', [UUID]);
}
QueryCacher.clearVideoCache(videoInfo);
QueryCacher.clearSegmentCache(videoInfo);
}
if (incrementAmount - oldIncrementAmount !== 0) {
sendWebhooks({