- setCachedRoute (req: express.Request, body: any, lifetime: number, contentType?: string, statusCode?: number) {
- const cached: CachedRoute = Object.assign({}, {
- body: body.toString()
- },
- (contentType) ? { contentType } : null,
- (statusCode) ? { statusCode: statusCode.toString() } : null
- )
+ async doesVideoIPViewExist (ip: string, videoUUID: string) {
+ return this.exists(this.generateIPViewKey(ip, videoUUID))
+ }
+
+ async doesVideoIPViewerExist (ip: string, videoUUID: string) {
+ return this.exists(this.generateIPViewerKey(ip, videoUUID))
+ }
+
+ /* ************ Tracker IP block ************ */
+
+ setTrackerBlockIP (ip: string) {
+ return this.setValue(this.generateTrackerBlockIPKey(ip), '1', TRACKER_RATE_LIMITS.BLOCK_IP_LIFETIME)
+ }