aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-27 15:09:53 +0200
committerChocobozzz <me@florianbigard.com>2018-03-27 15:09:53 +0200
commit3e0c9ff5d5d2a2435fcc25deac3a98223aa7c225 (patch)
tree09d7c61272d5ce482fd9edcf5f88e2b0f6dac507 /server/models/video
parent586f7c1bef1e95c2b8c74d2e9b074cc004630467 (diff)
downloadPeerTube-3e0c9ff5d5d2a2435fcc25deac3a98223aa7c225.tar.gz
PeerTube-3e0c9ff5d5d2a2435fcc25deac3a98223aa7c225.tar.zst
PeerTube-3e0c9ff5d5d2a2435fcc25deac3a98223aa7c225.zip
Add ability to search on domain and username too
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/video.ts20
1 files changed, 17 insertions, 3 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 3611eca89..a28b5209b 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -676,9 +676,23 @@ export class VideoModel extends Model<VideoModel> {
676 limit: count, 676 limit: count,
677 order: getSort(sort), 677 order: getSort(sort),
678 where: { 678 where: {
679 name: { 679 [Sequelize.Op.or]: [
680 [Sequelize.Op.iLike]: '%' + value + '%' 680 {
681 } 681 name: {
682 [ Sequelize.Op.iLike ]: '%' + value + '%'
683 }
684 },
685 {
686 preferredUsername: Sequelize.where(Sequelize.col('preferredUsername'), {
687 [ Sequelize.Op.iLike ]: '%' + value + '%'
688 })
689 },
690 {
691 host: Sequelize.where(Sequelize.col('host'), {
692 [ Sequelize.Op.iLike ]: '%' + value + '%'
693 })
694 }
695 ]
682 } 696 }
683 } 697 }
684 698