mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-17 13:08:49 +03:00
add service to table only have videoID
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import { getHash } from "./getHash";
|
||||
import { HashedValue } from "../types/hash.model";
|
||||
import { ActionType, VideoID } from "../types/segments.model";
|
||||
import { ActionType, VideoID, Service } from "../types/segments.model";
|
||||
import { UserID } from "../types/user.model";
|
||||
|
||||
export function getSubmissionUUID(videoID: VideoID, actionType: ActionType, userID: UserID, startTime: number, endTime: number): HashedValue{
|
||||
return `4${getHash(`${videoID}${startTime}${endTime}${userID}${actionType}`, 1)}` as HashedValue;
|
||||
export function getSubmissionUUID(
|
||||
videoID: VideoID,
|
||||
actionType: ActionType,
|
||||
userID: UserID,
|
||||
startTime: number,
|
||||
endTime: number,
|
||||
service: Service
|
||||
) : HashedValue {
|
||||
return `5${getHash(`${videoID}${startTime}${endTime}${userID}${actionType}${service}`, 1)}` as HashedValue;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function getReputation(userID: UserID): Promise<number> {
|
||||
c."category" = "a"."category" LIMIT 1)
|
||||
AND EXISTS (
|
||||
SELECT * FROM "lockCategories" as l
|
||||
WHERE l."videoID" = "a"."videoID" AND l."category" = "a"."category" LIMIT 1)
|
||||
WHERE l."videoID" = "a"."videoID" AND l."service" = "a"."service" AND l."category" = "a"."category" LIMIT 1)
|
||||
THEN 1 ELSE 0 END) AS "mostUpvotedInLockedVideoSum"
|
||||
FROM "sponsorTimes" as "a" WHERE "userID" = ?`, [userID, weekAgo, pastDate, userID]) as Promise<ReputationDBResult>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user