X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Factivitypub.ts;h=31c6187d108d9ea60fbc4e2607f51fffc54a557f;hb=7ccddd7b5250bd25a917a6e77e58b87b9484a2a4;hp=79b76fa0b89e2636bf6dc177363f2f8c9ffbc1c3;hpb=bc22d60899e14631cba0fb6450f4e85fc9528293;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts index 79b76fa0b..31c6187d1 100644 --- a/server/helpers/activitypub.ts +++ b/server/helpers/activitypub.ts @@ -15,7 +15,7 @@ function activityPubContextify (data: T) { 'https://w3id.org/security/v1', { RsaSignature2017: 'https://w3id.org/security#RsaSignature2017', - pt: 'https://joinpeertube.org/ns', + pt: 'https://joinpeertube.org/ns#', sc: 'http://schema.org#', Hashtag: 'as:Hashtag', uuid: 'sc:identifier', @@ -28,11 +28,17 @@ function activityPubContextify (data: T) { state: 'sc:Number', size: 'sc:Number', fps: 'sc:Number', + startTimestamp: 'sc:Number', + stopTimestamp: 'sc:Number', + position: 'sc:Number', commentsEnabled: 'sc:Boolean', + downloadEnabled: 'sc:Boolean', waitTranscoding: 'sc:Boolean', expires: 'sc:expires', support: 'sc:Text', - CacheFile: 'pt:CacheFile' + CacheFile: 'pt:CacheFile', + Infohash: 'pt:Infohash', + originallyPublishedAt: 'sc:DateTime' }, { likes: { @@ -43,6 +49,10 @@ function activityPubContextify (data: T) { '@id': 'as:dislikes', '@type': '@id' }, + playlists: { + '@id': 'pt:playlists', + '@type': '@id' + }, shares: { '@id': 'as:shares', '@type': '@id' @@ -64,7 +74,7 @@ async function activityPubCollectionPagination (baseUrl: string, handler: Activi return { id: baseUrl, - type: 'OrderedCollection', + type: 'OrderedCollectionPage', totalItems: result.total, first: baseUrl + '?page=1' } @@ -106,7 +116,7 @@ function buildSignedActivity (byActor: ActorModel, data: Object) { return signJsonLDObject(byActor, activity) as Promise } -function getAPUrl (activity: string | { id: string }) { +function getAPId (activity: string | { id: string }) { if (typeof activity === 'string') return activity return activity.id @@ -123,7 +133,7 @@ function checkUrlsSameHost (url1: string, url2: string) { export { checkUrlsSameHost, - getAPUrl, + getAPId, activityPubContextify, activityPubCollectionPagination, buildSignedActivity