X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Furl.ts;h=2e7c56955523241ed6856100e16e504225efceff;hb=d4defe07d26013a75577b30608841fe3f8334308;hp=ba3bf688d634d036f0877eab1d8c865f78da9a9e;hpb=46531a0abdd5c860a1a8cdb4b636b9c55bfb115b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/url.ts b/server/lib/activitypub/url.ts index ba3bf688d..2e7c56955 100644 --- a/server/lib/activitypub/url.ts +++ b/server/lib/activitypub/url.ts @@ -4,17 +4,24 @@ import { ActorFollowModel } from '../../models/activitypub/actor-follow' import { VideoModel } from '../../models/video/video' import { VideoAbuseModel } from '../../models/video/video-abuse' import { VideoCommentModel } from '../../models/video/video-comment' +import { VideoFileModel } from '../../models/video/video-file' function getVideoActivityPubUrl (video: VideoModel) { return CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid } +function getVideoCacheFileActivityPubUrl (videoFile: VideoFileModel) { + const suffixFPS = videoFile.fps ? '-' + videoFile.fps : '' + + return `${CONFIG.WEBSERVER.URL}/redundancy/videos/${videoFile.Video.uuid}/${videoFile.resolution}${suffixFPS}` +} + function getVideoCommentActivityPubUrl (video: VideoModel, videoComment: VideoCommentModel) { return CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid + '/comments/' + videoComment.id } -function getVideoChannelActivityPubUrl (videoChannelUUID: string) { - return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannelUUID +function getVideoChannelActivityPubUrl (videoChannelName: string) { + return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannelName } function getAccountActivityPubUrl (accountName: string) { @@ -101,5 +108,6 @@ export { getVideoSharesActivityPubUrl, getVideoCommentsActivityPubUrl, getVideoLikesActivityPubUrl, - getVideoDislikesActivityPubUrl + getVideoDislikesActivityPubUrl, + getVideoCacheFileActivityPubUrl }