1 import { VideoModel } from '../models/video/video'
2 import { VideoCommentModel } from '../models/video/video-comment'
3 import { VideoCommentCreate } from '../../shared/models/videos/video-comment.model'
4 import { VideoCreate, VideoImportCreate } from '../../shared/models/videos'
5 import { UserModel } from '../models/account/user'
6 import { VideoTorrentObject } from '../../shared/models/activitypub/objects'
7 import { ActivityCreate } from '../../shared/models/activitypub'
8 import { ActorModel } from '../models/activitypub/actor'
9 import { VideoCommentObject } from '../../shared/models/activitypub/objects/video-comment-object'
10 import { VideoFileModel } from '@server/models/video/video-file'
11 import { PathLike } from 'fs-extra'
12 import { MUser } from '@server/typings/models'
14 export type AcceptResult = {
19 // Can be filtered by plugins
20 function isLocalVideoAccepted (object: {
21 videoBody: VideoCreate
22 videoFile: Express.Multer.File & { duration?: number }
25 return { accepted: true }
28 function isLocalVideoThreadAccepted (_object: {
29 commentBody: VideoCommentCreate
33 return { accepted: true }
36 function isLocalVideoCommentReplyAccepted (_object: {
37 commentBody: VideoCommentCreate
38 parentComment: VideoCommentModel
42 return { accepted: true }
45 function isRemoteVideoAccepted (_object: {
46 activity: ActivityCreate
47 videoAP: VideoTorrentObject
50 return { accepted: true }
53 function isRemoteVideoCommentAccepted (_object: {
54 activity: ActivityCreate
55 commentAP: VideoCommentObject
58 return { accepted: true }
61 function isPreImportVideoAccepted (object: {
62 videoImportBody: VideoImportCreate
65 return { accepted: true }
68 function isPostImportVideoAccepted (object: {
69 videoFilePath: PathLike
70 videoFile: VideoFileModel
73 return { accepted: true }
78 isLocalVideoThreadAccepted,
79 isRemoteVideoAccepted,
80 isRemoteVideoCommentAccepted,
81 isLocalVideoCommentReplyAccepted,
82 isPreImportVideoAccepted,
83 isPostImportVideoAccepted