]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/activitypub.ts
Move adding a video view videojs peertube plugin
[github/Chocobozzz/PeerTube.git] / server / helpers / activitypub.ts
index 97115680cd129383ed27eaf6cc6a934863a2add3..eaee324eb1e5fe38102033a17847ed579f075728 100644 (file)
@@ -20,13 +20,32 @@ function activityPubContextify <T> (data: T) {
         'views': 'http://schema.org/Number',
         'size': 'http://schema.org/Number',
         'commentsEnabled': 'http://schema.org/Boolean'
+      },
+      {
+        likes: {
+          '@id': 'as:likes',
+          '@type': '@id'
+        },
+        dislikes: {
+          '@id': 'as:dislikes',
+          '@type': '@id'
+        },
+        shares: {
+          '@id': 'as:shares',
+          '@type': '@id'
+        },
+        comments: {
+          '@id': 'as:comments',
+          '@type': '@id'
+        }
       }
     ]
   })
 }
 
-function activityPubCollection (results: any[]) {
+function activityPubCollection (url: string, results: any[]) {
   return {
+    id: url,
     type: 'OrderedCollection',
     totalItems: results.length,
     orderedItems: results