diff --git a/src/routes/getSkipSegments.ts b/src/routes/getSkipSegments.ts index dd9a15b..88e61cb 100644 --- a/src/routes/getSkipSegments.ts +++ b/src/routes/getSkipSegments.ts @@ -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; } diff --git a/src/types/segments.model.ts b/src/types/segments.model.ts index 61b4f64..fab891f 100644 --- a/src/types/segments.model.ts +++ b/src/types/segments.model.ts @@ -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; }