From c0d2eac3329ec4454a178a4442bdcf20c388c8ff Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 14 Jan 2022 14:15:23 +0100 Subject: Update server dependencies --- server/lib/redis.ts | 6 ++++-- server/models/utils.ts | 3 ++- server/models/video/video.ts | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/lib/redis.ts b/server/lib/redis.ts index 52766663a..f544274ea 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts @@ -365,8 +365,10 @@ class Redis { return this.client.incr(this.prefix + key) } - private exists (key: string) { - return this.client.exists(this.prefix + key) + private async exists (key: string) { + const result = await this.client.exists(this.prefix + key) + + return result !== 0 } private setExpiration (key: string, ms: number) { diff --git a/server/models/utils.ts b/server/models/utils.ts index 6a109056f..8c694d4e5 100644 --- a/server/models/utils.ts +++ b/server/models/utils.ts @@ -238,7 +238,8 @@ function searchAttribute (sourceField?: string, targetField?: string) { return { [targetField]: { - [Op.iLike]: `%${sourceField}%` + // FIXME: ts error + [Op.iLike as any]: `%${sourceField}%` } } } diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 12b937574..9111c71b0 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1488,7 +1488,8 @@ export class VideoModel extends Model>> { required: false, where: { startDate: { - [Op.gte]: new Date(new Date().getTime() - (24 * 3600 * 1000) * trendingDays) + // FIXME: ts error + [Op.gte as any]: new Date(new Date().getTime() - (24 * 3600 * 1000) * trendingDays) } } } -- cgit v1.2.3