Add shadowHidden type

This commit is contained in:
Ajay Ramachandran 2020-12-28 18:57:57 -05:00
parent e3e9c89a80
commit 30823b752d
2 changed files with 8 additions and 3 deletions

View file

@ -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;
}

View file

@ -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;
}