mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-08 12:37:00 +03:00
Fix full video different category duplicate error
This commit is contained in:
@@ -239,7 +239,7 @@ async function autoModerateSubmission(apiVideoInfo: APIVideoInfo,
|
|||||||
const startTime = parseFloat(segments[i].segment[0]);
|
const startTime = parseFloat(segments[i].segment[0]);
|
||||||
const endTime = parseFloat(segments[i].segment[1]);
|
const endTime = parseFloat(segments[i].segment[1]);
|
||||||
|
|
||||||
const UUID = getSubmissionUUID(submission.videoID, segments[i].actionType, submission.userID, startTime, endTime, submission.service);
|
const UUID = getSubmissionUUID(submission.videoID, segments[i].category, segments[i].actionType, submission.userID, startTime, endTime, submission.service);
|
||||||
// Send to Discord
|
// Send to Discord
|
||||||
// Note, if this is too spammy. Consider sending all the segments as one Webhook
|
// Note, if this is too spammy. Consider sending all the segments as one Webhook
|
||||||
sendWebhooksNB(submission.userID, submission.videoID, UUID, startTime, endTime, segments[i].category, nbPredictions.probabilities[predictionIdx], data);
|
sendWebhooksNB(submission.userID, submission.videoID, UUID, startTime, endTime, segments[i].category, nbPredictions.probabilities[predictionIdx], data);
|
||||||
@@ -654,7 +654,7 @@ export async function postSkipSegments(req: Request, res: Response): Promise<Res
|
|||||||
//this can just be a hash of the data
|
//this can just be a hash of the data
|
||||||
//it's better than generating an actual UUID like what was used before
|
//it's better than generating an actual UUID like what was used before
|
||||||
//also better for duplication checking
|
//also better for duplication checking
|
||||||
const UUID = getSubmissionUUID(videoID, segmentInfo.actionType, userID, parseFloat(segmentInfo.segment[0]), parseFloat(segmentInfo.segment[1]), service);
|
const UUID = getSubmissionUUID(videoID, segmentInfo.category, segmentInfo.actionType, userID, parseFloat(segmentInfo.segment[0]), parseFloat(segmentInfo.segment[1]), service);
|
||||||
const hashedVideoID = getHash(videoID, 1);
|
const hashedVideoID = getHash(videoID, 1);
|
||||||
|
|
||||||
const startingLocked = isVIP ? 1 : 0;
|
const startingLocked = isVIP ? 1 : 0;
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import { getHash } from "./getHash";
|
import { getHash } from "./getHash";
|
||||||
import { HashedValue } from "../types/hash.model";
|
import { HashedValue } from "../types/hash.model";
|
||||||
import { ActionType, VideoID, Service } from "../types/segments.model";
|
import { ActionType, VideoID, Service, Category } from "../types/segments.model";
|
||||||
import { UserID } from "../types/user.model";
|
import { UserID } from "../types/user.model";
|
||||||
|
|
||||||
export function getSubmissionUUID(
|
export function getSubmissionUUID(
|
||||||
videoID: VideoID,
|
videoID: VideoID,
|
||||||
|
category: Category,
|
||||||
actionType: ActionType,
|
actionType: ActionType,
|
||||||
userID: UserID,
|
userID: UserID,
|
||||||
startTime: number,
|
startTime: number,
|
||||||
endTime: number,
|
endTime: number,
|
||||||
service: Service
|
service: Service
|
||||||
) : HashedValue {
|
) : HashedValue {
|
||||||
return `5${getHash(`${videoID}${startTime}${endTime}${userID}${actionType}${service}`, 1)}` as HashedValue;
|
return `${getHash(`${videoID}${startTime}${endTime}${userID}${category}${actionType}${service}`, 1)}6` as HashedValue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user