aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 0041e4d38..0af70cadf 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -106,6 +106,7 @@ export enum ScopeNames {
106 actorId: number, 106 actorId: number,
107 hideNSFW: boolean, 107 hideNSFW: boolean,
108 filter?: VideoFilter, 108 filter?: VideoFilter,
109 category?: number,
109 withFiles?: boolean, 110 withFiles?: boolean,
110 accountId?: number, 111 accountId?: number,
111 videoChannelId?: number 112 videoChannelId?: number
@@ -215,6 +216,10 @@ export enum ScopeNames {
215 query.where['nsfw'] = false 216 query.where['nsfw'] = false
216 } 217 }
217 218
219 if (options.category) {
220 query.where['category'] = options.category
221 }
222
218 if (options.accountId) { 223 if (options.accountId) {
219 accountInclude.where = { 224 accountInclude.where = {
220 id: options.accountId 225 id: options.accountId
@@ -730,6 +735,7 @@ export class VideoModel extends Model<VideoModel> {
730 sort: string, 735 sort: string,
731 hideNSFW: boolean, 736 hideNSFW: boolean,
732 withFiles: boolean, 737 withFiles: boolean,
738 category?: number,
733 filter?: VideoFilter, 739 filter?: VideoFilter,
734 accountId?: number, 740 accountId?: number,
735 videoChannelId?: number 741 videoChannelId?: number
@@ -746,6 +752,7 @@ export class VideoModel extends Model<VideoModel> {
746 ScopeNames.AVAILABLE_FOR_LIST, { 752 ScopeNames.AVAILABLE_FOR_LIST, {
747 actorId: serverActor.id, 753 actorId: serverActor.id,
748 hideNSFW: options.hideNSFW, 754 hideNSFW: options.hideNSFW,
755 category: options.category,
749 filter: options.filter, 756 filter: options.filter,
750 withFiles: options.withFiles, 757 withFiles: options.withFiles,
751 accountId: options.accountId, 758 accountId: options.accountId,