projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
586f7c1
)
Add ability to search on domain and username too
author
Chocobozzz
<me@florianbigard.com>
Tue, 27 Mar 2018 13:09:53 +0000
(15:09 +0200)
committer
Chocobozzz
<me@florianbigard.com>
Tue, 27 Mar 2018 13:09:53 +0000
(15:09 +0200)
server/models/video/video.ts
patch
|
blob
|
history
diff --git
a/server/models/video/video.ts
b/server/models/video/video.ts
index 3611eca8900fa1b513c430f3216e44b26ea7ac1c..a28b5209b56a1fba95af02afbbadfe354f17e82c 100644
(file)
--- a/
server/models/video/video.ts
+++ b/
server/models/video/video.ts
@@
-676,9
+676,23
@@
export class VideoModel extends Model<VideoModel> {
limit: count,
order: getSort(sort),
where: {
- name: {
- [Sequelize.Op.iLike]: '%' + value + '%'
- }
+ [Sequelize.Op.or]: [
+ {
+ name: {
+ [ Sequelize.Op.iLike ]: '%' + value + '%'
+ }
+ },
+ {
+ preferredUsername: Sequelize.where(Sequelize.col('preferredUsername'), {
+ [ Sequelize.Op.iLike ]: '%' + value + '%'
+ })
+ },
+ {
+ host: Sequelize.where(Sequelize.col('host'), {
+ [ Sequelize.Op.iLike ]: '%' + value + '%'
+ })
+ }
+ ]
}
}