aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-01-13 09:16:15 +0100
committerGitHub <noreply@github.com>2021-01-13 09:16:15 +0100
commitd8b34ee55b654912f86bb8b472d391ced8c28f64 (patch)
treeefa2b8ac36c00fa6e9b5af3f13e54a47bc7a7701 /server/models/video/video.ts
parent22078471fbe5a4dea6177bd1fa19da1cf887679e (diff)
downloadPeerTube-d8b34ee55b654912f86bb8b472d391ced8c28f64.tar.gz
PeerTube-d8b34ee55b654912f86bb8b472d391ced8c28f64.tar.zst
PeerTube-d8b34ee55b654912f86bb8b472d391ced8c28f64.zip
Allow user to search through their watch history (#3576)
* allow user to search through their watch history * add tests for search in watch history * Update client/src/app/shared/shared-main/users/user-history.service.ts
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index abf823d4b..5027e980d 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -1087,6 +1087,7 @@ export class VideoModel extends Model {
1087 user?: MUserAccountId 1087 user?: MUserAccountId
1088 historyOfUser?: MUserId 1088 historyOfUser?: MUserId
1089 countVideos?: boolean 1089 countVideos?: boolean
1090 search?: string
1090 }) { 1091 }) {
1091 if ((options.filter === 'all-local' || options.filter === 'all') && !options.user.hasRight(UserRight.SEE_ALL_VIDEOS)) { 1092 if ((options.filter === 'all-local' || options.filter === 'all') && !options.user.hasRight(UserRight.SEE_ALL_VIDEOS)) {
1092 throw new Error('Try to filter all-local but no user has not the see all videos right') 1093 throw new Error('Try to filter all-local but no user has not the see all videos right')
@@ -1123,7 +1124,8 @@ export class VideoModel extends Model {
1123 includeLocalVideos: options.includeLocalVideos, 1124 includeLocalVideos: options.includeLocalVideos,
1124 user: options.user, 1125 user: options.user,
1125 historyOfUser: options.historyOfUser, 1126 historyOfUser: options.historyOfUser,
1126 trendingDays 1127 trendingDays,
1128 search: options.search
1127 } 1129 }
1128 1130
1129 return VideoModel.getAvailableForApi(queryOptions, options.countVideos) 1131 return VideoModel.getAvailableForApi(queryOptions, options.countVideos)