diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/account/user-video-history.ts | 3 | ||||
-rw-r--r-- | server/models/video/video.ts | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/server/models/account/user-video-history.ts b/server/models/account/user-video-history.ts index 45171fc60..6be1d65ea 100644 --- a/server/models/account/user-video-history.ts +++ b/server/models/account/user-video-history.ts | |||
@@ -55,10 +55,11 @@ export class UserVideoHistoryModel extends Model { | |||
55 | }) | 55 | }) |
56 | User: UserModel | 56 | User: UserModel |
57 | 57 | ||
58 | static listForApi (user: MUserAccountId, start: number, count: number) { | 58 | static listForApi (user: MUserAccountId, start: number, count: number, search?: string) { |
59 | return VideoModel.listForApi({ | 59 | return VideoModel.listForApi({ |
60 | start, | 60 | start, |
61 | count, | 61 | count, |
62 | search, | ||
62 | sort: '-"userVideoHistory"."updatedAt"', | 63 | sort: '-"userVideoHistory"."updatedAt"', |
63 | nsfw: null, // All | 64 | nsfw: null, // All |
64 | includeLocalVideos: true, | 65 | includeLocalVideos: true, |
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) |