diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-18 14:28:37 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | b4055e1c23eeefb0c8a85a77f312b2827d98f483 (patch) | |
tree | 51b6b04c1ad10897047817d2eaaa037d1331fa6a /server/models/video | |
parent | 66e001c848c009412c65cbce41be344d8985fd83 (diff) | |
download | PeerTube-b4055e1c23eeefb0c8a85a77f312b2827d98f483.tar.gz PeerTube-b4055e1c23eeefb0c8a85a77f312b2827d98f483.tar.zst PeerTube-b4055e1c23eeefb0c8a85a77f312b2827d98f483.zip |
Add server hooks
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video-comment.ts | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index fee11ec5f..536b6cb3e 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -293,7 +293,15 @@ export class VideoCommentModel extends Model<VideoCommentModel> { | |||
293 | return VideoCommentModel.scope([ ScopeNames.WITH_IN_REPLY_TO, ScopeNames.WITH_VIDEO ]).findOne(query) | 293 | return VideoCommentModel.scope([ ScopeNames.WITH_IN_REPLY_TO, ScopeNames.WITH_VIDEO ]).findOne(query) |
294 | } | 294 | } |
295 | 295 | ||
296 | static async listThreadsForApi (videoId: number, start: number, count: number, sort: string, user?: UserModel) { | 296 | static async listThreadsForApi (parameters: { |
297 | videoId: number, | ||
298 | start: number, | ||
299 | count: number, | ||
300 | sort: string, | ||
301 | user?: UserModel | ||
302 | }) { | ||
303 | const { videoId, start, count, sort, user } = parameters | ||
304 | |||
297 | const serverActor = await getServerActor() | 305 | const serverActor = await getServerActor() |
298 | const serverAccountId = serverActor.Account.id | 306 | const serverAccountId = serverActor.Account.id |
299 | const userAccountId = user ? user.Account.id : undefined | 307 | const userAccountId = user ? user.Account.id : undefined |
@@ -328,7 +336,13 @@ export class VideoCommentModel extends Model<VideoCommentModel> { | |||
328 | }) | 336 | }) |
329 | } | 337 | } |
330 | 338 | ||
331 | static async listThreadCommentsForApi (videoId: number, threadId: number, user?: UserModel) { | 339 | static async listThreadCommentsForApi (parameters: { |
340 | videoId: number, | ||
341 | threadId: number, | ||
342 | user?: UserModel | ||
343 | }) { | ||
344 | const { videoId, threadId, user } = parameters | ||
345 | |||
332 | const serverActor = await getServerActor() | 346 | const serverActor = await getServerActor() |
333 | const serverAccountId = serverActor.Account.id | 347 | const serverAccountId = serverActor.Account.id |
334 | const userAccountId = user ? user.Account.id : undefined | 348 | const userAccountId = user ? user.Account.id : undefined |