mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Remove category from segment id
This commit is contained in:
parent
ed5de984f2
commit
a471e057f5
2 changed files with 4 additions and 4 deletions
|
@ -235,7 +235,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].category, segments[i].actionType, submission.userID, startTime, endTime);
|
const UUID = getSubmissionUUID(submission.videoID, segments[i].actionType, submission.userID, startTime, endTime);
|
||||||
// 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);
|
||||||
|
@ -520,7 +520,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.category, segmentInfo.actionType, userID, parseFloat(segmentInfo.segment[0]), parseFloat(segmentInfo.segment[1]));
|
const UUID = getSubmissionUUID(videoID, segmentInfo.actionType, userID, parseFloat(segmentInfo.segment[0]), parseFloat(segmentInfo.segment[1]));
|
||||||
const hashedVideoID = getHash(videoID, 1);
|
const hashedVideoID = getHash(videoID, 1);
|
||||||
|
|
||||||
const startingLocked = isVIP ? 1 : 0;
|
const startingLocked = isVIP ? 1 : 0;
|
||||||
|
|
|
@ -3,6 +3,6 @@ import { HashedValue } from '../types/hash.model';
|
||||||
import { ActionType, Category, VideoID } from '../types/segments.model';
|
import { ActionType, Category, VideoID } from '../types/segments.model';
|
||||||
import { UserID } from '../types/user.model';
|
import { UserID } from '../types/user.model';
|
||||||
|
|
||||||
export function getSubmissionUUID(videoID: VideoID, category: Category, actionType: ActionType, userID: UserID, startTime: number, endTime: number): HashedValue{
|
export function getSubmissionUUID(videoID: VideoID, actionType: ActionType, userID: UserID, startTime: number, endTime: number): HashedValue{
|
||||||
return `3${getHash('v3' + videoID + startTime + endTime + category + userID, 1)}` as HashedValue;
|
return `3${getHash('v3' + videoID + startTime + endTime + userID, 1)}` as HashedValue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue