aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/activitypub/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-14 17:38:41 +0100
committerChocobozzz <me@florianbigard.com>2017-12-19 10:53:16 +0100
commit50d6de9c286abcb34ff4234d56d9cbb803db7665 (patch)
treef1732b27edcd05c7877a8358b8312f1e38c287ed /server/helpers/custom-validators/activitypub/videos.ts
parentfadf619ad61a016c1c7fc53de5a8f398a4f77519 (diff)
downloadPeerTube-50d6de9c286abcb34ff4234d56d9cbb803db7665.tar.gz
PeerTube-50d6de9c286abcb34ff4234d56d9cbb803db7665.tar.zst
PeerTube-50d6de9c286abcb34ff4234d56d9cbb803db7665.zip
Begin moving video channel to actor
Diffstat (limited to 'server/helpers/custom-validators/activitypub/videos.ts')
-rw-r--r--server/helpers/custom-validators/activitypub/videos.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts
index 2ed2988f5..b485e5fcf 100644
--- a/server/helpers/custom-validators/activitypub/videos.ts
+++ b/server/helpers/custom-validators/activitypub/videos.ts
@@ -10,10 +10,10 @@ import {
10 isVideoTruncatedDescriptionValid, 10 isVideoTruncatedDescriptionValid,
11 isVideoViewsValid 11 isVideoViewsValid
12} from '../videos' 12} from '../videos'
13import { isActivityPubUrlValid, isBaseActivityValid } from './misc' 13import { isActivityPubUrlValid, isBaseActivityValid, setValidAttributedTo } from './misc'
14 14
15function isVideoTorrentAddActivityValid (activity: any) { 15function isVideoTorrentCreateActivityValid (activity: any) {
16 return isBaseActivityValid(activity, 'Add') && 16 return isBaseActivityValid(activity, 'Create') &&
17 isVideoTorrentObjectValid(activity.object) 17 isVideoTorrentObjectValid(activity.object)
18} 18}
19 19
@@ -43,6 +43,8 @@ function isActivityPubVideoDurationValid (value: string) {
43} 43}
44 44
45function isVideoTorrentObjectValid (video: any) { 45function isVideoTorrentObjectValid (video: any) {
46 console.log(video)
47
46 return video.type === 'Video' && 48 return video.type === 'Video' &&
47 isActivityPubUrlValid(video.id) && 49 isActivityPubUrlValid(video.id) &&
48 isVideoNameValid(video.name) && 50 isVideoNameValid(video.name) &&
@@ -59,13 +61,15 @@ function isVideoTorrentObjectValid (video: any) {
59 (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) && 61 (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) &&
60 isRemoteVideoIconValid(video.icon) && 62 isRemoteVideoIconValid(video.icon) &&
61 setValidRemoteVideoUrls(video) && 63 setValidRemoteVideoUrls(video) &&
62 video.url.length !== 0 64 video.url.length !== 0 &&
65 setValidAttributedTo(video) &&
66 video.attributedTo.length !== 0
63} 67}
64 68
65// --------------------------------------------------------------------------- 69// ---------------------------------------------------------------------------
66 70
67export { 71export {
68 isVideoTorrentAddActivityValid, 72 isVideoTorrentCreateActivityValid,
69 isVideoTorrentUpdateActivityValid, 73 isVideoTorrentUpdateActivityValid,
70 isVideoTorrentDeleteActivityValid, 74 isVideoTorrentDeleteActivityValid,
71 isVideoFlagValid 75 isVideoFlagValid