import { Video, VideoDetails } from '../../../shared/models/videos'
import { VideoModel } from './video'
-import { ActivityTagObject, ActivityUrlObject, VideoTorrentObject } from '../../../shared/models/activitypub/objects'
+import { ActivityTagObject, ActivityUrlObject, VideoObject } from '../../../shared/models/activitypub/objects'
import { MIMETYPES, WEBSERVER } from '../../initializers/constants'
import { VideoCaptionModel } from './video-caption'
import {
const video = extractVideo(model)
return [ ...videoFiles ]
+ .filter(f => !f.isLive())
.sort(sortByResolutionDesc)
.map(videoFile => {
return {
baseUrlWs: string,
files: MVideoFile[]
) {
- const sortedFiles = [ ...files ].sort(sortByResolutionDesc)
+ const sortedFiles = [ ...files ]
+ .filter(f => !f.isLive())
+ .sort(sortByResolutionDesc)
for (const file of sortedFiles) {
acc.push({
}
}
-function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject {
+function videoModelToActivityPubObject (video: MVideoAP): VideoObject {
const { baseUrlHttp, baseUrlWs } = video.getBaseUrls()
if (!video.Tags) video.Tags = []
views: video.views,
sensitive: video.nsfw,
waitTranscoding: video.waitTranscoding,
+ isLiveBroadcast: video.isLive,
+
+ liveSaveReplay: video.isLive
+ ? video.VideoLive.saveReplay
+ : null,
+
state: video.state,
commentsEnabled: video.commentsEnabled,
downloadEnabled: video.downloadEnabled,
published: video.publishedAt.toISOString(),
- originallyPublishedAt: video.originallyPublishedAt ? video.originallyPublishedAt.toISOString() : null,
+
+ originallyPublishedAt: video.originallyPublishedAt
+ ? video.originallyPublishedAt.toISOString()
+ : null,
+
updated: video.updatedAt.toISOString(),
mediaType: 'text/markdown',
content: video.description,