diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-26 16:59:02 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-26 16:59:02 +0200 |
commit | c2962505115563ad1510e8116f3b362887cac71f (patch) | |
tree | 530d930e48f45aad27b429621542a6bca1dc1b60 /server/models/video | |
parent | a265f7f30fe5f25e742c99c6d43e79dfd46bf2a9 (diff) | |
download | PeerTube-c2962505115563ad1510e8116f3b362887cac71f.tar.gz PeerTube-c2962505115563ad1510e8116f3b362887cac71f.tar.zst PeerTube-c2962505115563ad1510e8116f3b362887cac71f.zip |
Remove sequelize deprecated operators
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 6c0db59f3..27f59f3a9 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1012,7 +1012,7 @@ searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, s | |||
1012 | } | 1012 | } |
1013 | } else if (field === 'tags') { | 1013 | } else if (field === 'tags') { |
1014 | const escapedValue = Video['sequelize'].escape('%' + value + '%') | 1014 | const escapedValue = Video['sequelize'].escape('%' + value + '%') |
1015 | query.where['id'].$in = Video['sequelize'].literal( | 1015 | query.where['id'][Sequelize.Op.in] = Video['sequelize'].literal( |
1016 | `(SELECT "VideoTags"."videoId" | 1016 | `(SELECT "VideoTags"."videoId" |
1017 | FROM "Tags" | 1017 | FROM "Tags" |
1018 | INNER JOIN "VideoTags" ON "Tags"."id" = "VideoTags"."tagId" | 1018 | INNER JOIN "VideoTags" ON "Tags"."id" = "VideoTags"."tagId" |
@@ -1023,19 +1023,19 @@ searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, s | |||
1023 | // FIXME: Include our pod? (not stored in the database) | 1023 | // FIXME: Include our pod? (not stored in the database) |
1024 | podInclude.where = { | 1024 | podInclude.where = { |
1025 | host: { | 1025 | host: { |
1026 | $iLike: '%' + value + '%' | 1026 | [Sequelize.Op.iLike]: '%' + value + '%' |
1027 | } | 1027 | } |
1028 | } | 1028 | } |
1029 | podInclude.required = true | 1029 | podInclude.required = true |
1030 | } else if (field === 'author') { | 1030 | } else if (field === 'author') { |
1031 | authorInclude.where = { | 1031 | authorInclude.where = { |
1032 | name: { | 1032 | name: { |
1033 | $iLike: '%' + value + '%' | 1033 | [Sequelize.Op.iLike]: '%' + value + '%' |
1034 | } | 1034 | } |
1035 | } | 1035 | } |
1036 | } else { | 1036 | } else { |
1037 | query.where[field] = { | 1037 | query.where[field] = { |
1038 | $iLike: '%' + value + '%' | 1038 | [Sequelize.Op.iLike]: '%' + value + '%' |
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | 1041 | ||
@@ -1056,7 +1056,7 @@ searchAndPopulateAuthorAndPodAndTags = function (value: string, field: string, s | |||
1056 | function createBaseVideosWhere () { | 1056 | function createBaseVideosWhere () { |
1057 | return { | 1057 | return { |
1058 | id: { | 1058 | id: { |
1059 | $notIn: Video['sequelize'].literal( | 1059 | [Sequelize.Op.notIn]: Video['sequelize'].literal( |
1060 | '(SELECT "BlacklistedVideos"."videoId" FROM "BlacklistedVideos")' | 1060 | '(SELECT "BlacklistedVideos"."videoId" FROM "BlacklistedVideos")' |
1061 | ) | 1061 | ) |
1062 | } | 1062 | } |