mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Add shadowHidden type
This commit is contained in:
parent
e3e9c89a80
commit
30823b752d
2 changed files with 8 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { config } from '../config';
|
||||
import { db, privateDB } from '../databases/databases';
|
||||
import { Category, DBSegment, OverlappingSegmentGroup, Segment, SegmentCache, VideoData, VideoID, VideoIDHash, VotableObject } from "../types/segments.model";
|
||||
import { Category, DBSegment, OverlappingSegmentGroup, Segment, SegmentCache, VideoData, VideoID, VideoIDHash, Visibility, VotableObject } from "../types/segments.model";
|
||||
import { getHash } from '../utils/getHash';
|
||||
import { getIP } from '../utils/getIP';
|
||||
import { Logger } from '../utils/logger';
|
||||
|
@ -15,7 +15,7 @@ function prepareCategorySegments(req: Request, videoID: VideoID, category: Categ
|
|||
|
||||
//check if shadowHidden
|
||||
//this means it is hidden to everyone but the original ip that submitted it
|
||||
if (segment.shadowHidden != 1) {
|
||||
if (segment.shadowHidden != Visibility.HIDDEN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,18 @@ export interface Segment {
|
|||
UUID: SegmentUUID;
|
||||
}
|
||||
|
||||
export enum Visibility {
|
||||
VISIBLE = 0,
|
||||
HIDDEN = 1
|
||||
}
|
||||
|
||||
export interface DBSegment {
|
||||
category: Category;
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
UUID: SegmentUUID;
|
||||
votes: number;
|
||||
shadowHidden: 0 | 1;
|
||||
shadowHidden: Visibility;
|
||||
videoID: VideoID;
|
||||
hashedVideoID: VideoIDHash;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue