mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-26 17:38:28 +03:00
add tempVIP check to vote
This commit is contained in:
@@ -3,13 +3,11 @@ import { UserID } from "../types/user.model";
|
||||
import { HashedValue } from "../types/hash.model";
|
||||
import { Logger } from "./logger";
|
||||
|
||||
export function skipSegmentsKey(videoID: VideoID, service: Service): string {
|
||||
return `segments.v3.${service}.videoID.${videoID}`;
|
||||
}
|
||||
export const skipSegmentsKey = (videoID: VideoID, service: Service): string =>
|
||||
`segments.v3.${service}.videoID.${videoID}`;
|
||||
|
||||
export function skipSegmentGroupsKey(videoID: VideoID, service: Service): string {
|
||||
return `segments.groups.v2.${service}.videoID.${videoID}`;
|
||||
}
|
||||
export const skipSegmentGroupsKey = (videoID: VideoID, service: Service): string =>
|
||||
`segments.groups.v2.${service}.videoID.${videoID}`;
|
||||
|
||||
export function skipSegmentsHashKey(hashedVideoIDPrefix: VideoIDHash, service: Service): string {
|
||||
hashedVideoIDPrefix = hashedVideoIDPrefix.substring(0, 4) as VideoIDHash;
|
||||
@@ -18,9 +16,8 @@ export function skipSegmentsHashKey(hashedVideoIDPrefix: VideoIDHash, service: S
|
||||
return `segments.v3.${service}.${hashedVideoIDPrefix}`;
|
||||
}
|
||||
|
||||
export function reputationKey(userID: UserID): string {
|
||||
return `reputation.user.${userID}`;
|
||||
}
|
||||
export const reputationKey = (userID: UserID): string =>
|
||||
`reputation.user.${userID}`;
|
||||
|
||||
export function ratingHashKey(hashPrefix: VideoIDHash, service: Service): string {
|
||||
hashPrefix = hashPrefix.substring(0, 4) as VideoIDHash;
|
||||
@@ -33,4 +30,7 @@ export function shaHashKey(singleIter: HashedValue): string {
|
||||
if (singleIter.length !== 64) Logger.warn(`Redis sha.hash key is not length 64! ${singleIter}`);
|
||||
|
||||
return `sha.hash.${singleIter}`;
|
||||
}
|
||||
}
|
||||
|
||||
export const tempVIPKey = (userID: UserID): string =>
|
||||
`vip.temp.${userID}`;
|
||||
@@ -2,9 +2,11 @@ import { config } from "../config";
|
||||
import { Logger } from "../utils/logger";
|
||||
import axios from "axios";
|
||||
|
||||
function getVoteAuthorRaw(submissionCount: number, isVIP: boolean, isOwnSubmission: boolean): string {
|
||||
function getVoteAuthorRaw(submissionCount: number, isTempVIP: boolean, isVIP: boolean, isOwnSubmission: boolean): string {
|
||||
if (isOwnSubmission) {
|
||||
return "self";
|
||||
} else if (isTempVIP) {
|
||||
return "temp vip";
|
||||
} else if (isVIP) {
|
||||
return "vip";
|
||||
} else if (submissionCount === 0) {
|
||||
@@ -14,11 +16,13 @@ function getVoteAuthorRaw(submissionCount: number, isVIP: boolean, isOwnSubmissi
|
||||
}
|
||||
}
|
||||
|
||||
function getVoteAuthor(submissionCount: number, isVIP: boolean, isOwnSubmission: boolean): string {
|
||||
function getVoteAuthor(submissionCount: number, isTempVIP: boolean, isVIP: boolean, isOwnSubmission: boolean): string {
|
||||
if (submissionCount === 0) {
|
||||
return "Report by New User";
|
||||
} else if (isOwnSubmission) {
|
||||
return "Report by Submitter";
|
||||
} else if (isTempVIP) {
|
||||
return "Report by Temp VIP";
|
||||
} else if (isVIP) {
|
||||
return "Report by VIP User";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user