aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-view.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-27 14:32:44 +0200
committerChocobozzz <me@florianbigard.com>2021-08-27 15:12:22 +0200
commit41fb13c330de629df2d23379209e79c7af0f2e9a (patch)
tree73bc5a90566406b3910f142beae2a879c1e4265d /server/models/video/video-view.ts
parent40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff)
downloadPeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst
PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip
esModuleInterop to true
Diffstat (limited to 'server/models/video/video-view.ts')
-rw-r--r--server/models/video/video-view.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/models/video/video-view.ts b/server/models/video/video-view.ts
index dfc6296ce..b51f0f84d 100644
--- a/server/models/video/video-view.ts
+++ b/server/models/video/video-view.ts
@@ -1,5 +1,5 @@
1import * as Sequelize from 'sequelize' 1import { literal, Op } from 'sequelize'
2import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Table } from 'sequelize-typescript' 2import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Model, Table } from 'sequelize-typescript'
3import { AttributesOnly } from '@shared/core-utils' 3import { AttributesOnly } from '@shared/core-utils'
4import { VideoModel } from './video' 4import { VideoModel } from './video'
5 5
@@ -20,11 +20,11 @@ export class VideoViewModel extends Model<Partial<AttributesOnly<VideoViewModel>
20 createdAt: Date 20 createdAt: Date
21 21
22 @AllowNull(false) 22 @AllowNull(false)
23 @Column(Sequelize.DATE) 23 @Column(DataType.DATE)
24 startDate: Date 24 startDate: Date
25 25
26 @AllowNull(false) 26 @AllowNull(false)
27 @Column(Sequelize.DATE) 27 @Column(DataType.DATE)
28 endDate: Date 28 endDate: Date
29 29
30 @AllowNull(false) 30 @AllowNull(false)
@@ -47,10 +47,10 @@ export class VideoViewModel extends Model<Partial<AttributesOnly<VideoViewModel>
47 const query = { 47 const query = {
48 where: { 48 where: {
49 startDate: { 49 startDate: {
50 [Sequelize.Op.lt]: beforeDate 50 [Op.lt]: beforeDate
51 }, 51 },
52 videoId: { 52 videoId: {
53 [Sequelize.Op.in]: Sequelize.literal('(SELECT "id" FROM "video" WHERE "remote" IS TRUE)') 53 [Op.in]: literal('(SELECT "id" FROM "video" WHERE "remote" IS TRUE)')
54 } 54 }
55 } 55 }
56 } 56 }