+function addVideoFilesInAPAcc (
+ acc: ActivityUrlObject[] | ActivityTagObject[],
+ model: MVideoAP | MStreamingPlaylistVideo,
+ baseUrlHttp: string,
+ baseUrlWs: string,
+ files: MVideoFile[]
+) {
+ for (const file of files) {
+ acc.push({
+ type: 'Link',
+ mediaType: MIMETYPES.VIDEO.EXT_MIMETYPE[file.extname] as any,
+ href: model.getVideoFileUrl(file, baseUrlHttp),
+ height: file.resolution,
+ size: file.size,
+ fps: file.fps
+ })
+
+ acc.push({
+ type: 'Link',
+ mediaType: 'application/x-bittorrent' as 'application/x-bittorrent',
+ href: model.getTorrentUrl(file, baseUrlHttp),
+ height: file.resolution
+ })
+
+ acc.push({
+ type: 'Link',
+ mediaType: 'application/x-bittorrent;x-scheme-handler/magnet' as 'application/x-bittorrent;x-scheme-handler/magnet',
+ href: generateMagnetUri(model, file, baseUrlHttp, baseUrlWs),
+ height: file.resolution
+ })
+ }
+}
+
+function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject {