mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-30 19:38:28 +03:00
add getHashCache where applicable=
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Logger } from "../../utils/logger";
|
||||
import { HashedUserID, UserID } from "../../types/user.model";
|
||||
import { getHash } from "../../utils/getHash";
|
||||
import { getHashCache } from "../../utils/getHashCache";
|
||||
import { Request, Response } from "express";
|
||||
import { Service, VideoID } from "../../types/segments.model";
|
||||
import { QueryCacher } from "../../utils/queryCacher";
|
||||
@@ -28,7 +29,7 @@ export async function postClearCache(req: Request, res: Response): Promise<Respo
|
||||
}
|
||||
|
||||
// hash the userID as early as possible
|
||||
const hashedUserID: HashedUserID = getHash(userID);
|
||||
const hashedUserID: HashedUserID = await getHashCache(userID);
|
||||
// hash videoID
|
||||
const hashedVideoID: VideoIDHash = getHash(videoID, 1);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { db, privateDB } from "../../databases/databases";
|
||||
import { getHash } from "../../utils/getHash";
|
||||
import { getHashCache } from "../../utils/getHashCache";
|
||||
import { Logger } from "../../utils/logger";
|
||||
import { Request, Response } from "express";
|
||||
import { HashedUserID, UserID } from "../../types/user.model";
|
||||
@@ -25,7 +26,7 @@ export async function postRating(req: Request, res: Response): Promise<Response>
|
||||
}
|
||||
|
||||
const hashedIP: HashedIP = getHash(getIP(req) + config.globalSalt as IPAddress, 1);
|
||||
const hashedUserID: HashedUserID = getHash(privateUserID);
|
||||
const hashedUserID: HashedUserID = await getHashCache(privateUserID);
|
||||
const hashedVideoID = getHash(videoID, 1);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user