aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video.ts10
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
1056function createBaseVideosWhere () { 1056function 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 }