aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-11 16:27:07 +0200
committerChocobozzz <me@florianbigard.com>2018-09-13 14:05:49 +0200
commitc48e82b5e0478434de30626d14594a97f2402e7c (patch)
treea78e5272bd0fe4f5b41831e571e02d05f1515b82 /shared/models/activitypub
parenta651038487faa838bda3ce04695b08bc65baff70 (diff)
downloadPeerTube-c48e82b5e0478434de30626d14594a97f2402e7c.tar.gz
PeerTube-c48e82b5e0478434de30626d14594a97f2402e7c.tar.zst
PeerTube-c48e82b5e0478434de30626d14594a97f2402e7c.zip
Basic video redundancy implementation
Diffstat (limited to 'shared/models/activitypub')
-rw-r--r--shared/models/activitypub/activity.ts6
-rw-r--r--shared/models/activitypub/objects/cache-file-object.ts9
-rw-r--r--shared/models/activitypub/objects/common-objects.ts25
-rw-r--r--shared/models/activitypub/objects/index.ts1
-rw-r--r--shared/models/activitypub/objects/video-torrent-object.ts4
5 files changed, 35 insertions, 10 deletions
diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts
index 46e883e5f..44cb99efb 100644
--- a/shared/models/activitypub/activity.ts
+++ b/shared/models/activitypub/activity.ts
@@ -1,6 +1,6 @@
1import { ActivityPubActor } from './activitypub-actor' 1import { ActivityPubActor } from './activitypub-actor'
2import { ActivityPubSignature } from './activitypub-signature' 2import { ActivityPubSignature } from './activitypub-signature'
3import { VideoTorrentObject } from './objects' 3import { CacheFileObject, VideoTorrentObject } from './objects'
4import { DislikeObject } from './objects/dislike-object' 4import { DislikeObject } from './objects/dislike-object'
5import { VideoAbuseObject } from './objects/video-abuse-object' 5import { VideoAbuseObject } from './objects/video-abuse-object'
6import { VideoCommentObject } from './objects/video-comment-object' 6import { VideoCommentObject } from './objects/video-comment-object'
@@ -29,12 +29,12 @@ export interface BaseActivity {
29 29
30export interface ActivityCreate extends BaseActivity { 30export interface ActivityCreate extends BaseActivity {
31 type: 'Create' 31 type: 'Create'
32 object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject 32 object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject | CacheFileObject
33} 33}
34 34
35export interface ActivityUpdate extends BaseActivity { 35export interface ActivityUpdate extends BaseActivity {
36 type: 'Update' 36 type: 'Update'
37 object: VideoTorrentObject | ActivityPubActor 37 object: VideoTorrentObject | ActivityPubActor | CacheFileObject
38} 38}
39 39
40export interface ActivityDelete extends BaseActivity { 40export interface ActivityDelete extends BaseActivity {
diff --git a/shared/models/activitypub/objects/cache-file-object.ts b/shared/models/activitypub/objects/cache-file-object.ts
new file mode 100644
index 000000000..0a5125f5b
--- /dev/null
+++ b/shared/models/activitypub/objects/cache-file-object.ts
@@ -0,0 +1,9 @@
1import { ActivityVideoUrlObject } from './common-objects'
2
3export interface CacheFileObject {
4 id: string
5 type: 'CacheFile',
6 object: string
7 expires: string
8 url: ActivityVideoUrlObject
9}
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts
index ff2cfdbb4..1de60da94 100644
--- a/shared/models/activitypub/objects/common-objects.ts
+++ b/shared/models/activitypub/objects/common-objects.ts
@@ -17,16 +17,31 @@ export interface ActivityIconObject {
17 height: number 17 height: number
18} 18}
19 19
20export interface ActivityUrlObject { 20export type ActivityVideoUrlObject = {
21 type: 'Link' 21 type: 'Link'
22 mimeType: 'video/mp4' | 'video/webm' | 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet' 22 mimeType: 'video/mp4' | 'video/webm' | 'video/ogg'
23 href: string 23 href: string
24 height: number 24 height: number
25 25 size: number
26 size?: number 26 fps: number
27 fps?: number
28} 27}
29 28
29export type ActivityUrlObject =
30 ActivityVideoUrlObject
31 |
32 {
33 type: 'Link'
34 mimeType: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet'
35 href: string
36 height: number
37 }
38 |
39 {
40 type: 'Link'
41 mimeType: 'text/html'
42 href: string
43 }
44
30export interface ActivityPubAttributedTo { 45export interface ActivityPubAttributedTo {
31 type: 'Group' | 'Person' 46 type: 'Group' | 'Person'
32 id: string 47 id: string
diff --git a/shared/models/activitypub/objects/index.ts b/shared/models/activitypub/objects/index.ts
index 3efd3ef13..fba61e12f 100644
--- a/shared/models/activitypub/objects/index.ts
+++ b/shared/models/activitypub/objects/index.ts
@@ -1,3 +1,4 @@
1export * from './cache-file-object'
1export * from './common-objects' 2export * from './common-objects'
2export * from './video-abuse-object' 3export * from './video-abuse-object'
3export * from './video-torrent-object' 4export * from './video-torrent-object'
diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts
index 90de8967b..8504c178f 100644
--- a/shared/models/activitypub/objects/video-torrent-object.ts
+++ b/shared/models/activitypub/objects/video-torrent-object.ts
@@ -1,10 +1,10 @@
1import { 1import {
2 ActivityIconObject, 2 ActivityIconObject,
3 ActivityIdentifierObject, ActivityPubAttributedTo, 3 ActivityIdentifierObject,
4 ActivityPubAttributedTo,
4 ActivityTagObject, 5 ActivityTagObject,
5 ActivityUrlObject 6 ActivityUrlObject
6} from './common-objects' 7} from './common-objects'
7import { ActivityPubOrderedCollection } from '../activitypub-ordered-collection'
8import { VideoState } from '../../videos' 8import { VideoState } from '../../videos'
9 9
10export interface VideoTorrentObject { 10export interface VideoTorrentObject {