import { MIMETYPES, WEBSERVER } from '../../initializers/constants'
import { VideoCaptionModel } from './video-caption'
import {
- getVideoCommentsActivityPubUrl,
- getVideoDislikesActivityPubUrl,
- getVideoLikesActivityPubUrl,
- getVideoSharesActivityPubUrl
+ getLocalVideoCommentsActivityPubUrl,
+ getLocalVideoDislikesActivityPubUrl,
+ getLocalVideoLikesActivityPubUrl,
+ getLocalVideoSharesActivityPubUrl
} from '../../lib/activitypub/url'
import { isArray } from '../../helpers/custom-validators/misc'
import { VideoStreamingPlaylist } from '../../../shared/models/videos/video-streaming-playlist.model'
account: video.VideoChannel.Account.toFormattedSummaryJSON(),
channel: video.VideoChannel.toFormattedSummaryJSON(),
- userHistory: userHistory ? {
- currentTime: userHistory.currentTime
- } : undefined,
+ userHistory: userHistory
+ ? { currentTime: userHistory.currentTime }
+ : undefined,
// Can be added by external plugins
pluginData: (video as any).pluginData
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({
? video.VideoLive.saveReplay
: null,
+ permanentLive: video.isLive
+ ? video.VideoLive.permanentLive
+ : null,
+
state: video.state,
commentsEnabled: video.commentsEnabled,
downloadEnabled: video.downloadEnabled,
height: i.height
})),
url,
- likes: getVideoLikesActivityPubUrl(video),
- dislikes: getVideoDislikesActivityPubUrl(video),
- shares: getVideoSharesActivityPubUrl(video),
- comments: getVideoCommentsActivityPubUrl(video),
+ likes: getLocalVideoLikesActivityPubUrl(video),
+ dislikes: getLocalVideoDislikesActivityPubUrl(video),
+ shares: getLocalVideoSharesActivityPubUrl(video),
+ comments: getLocalVideoCommentsActivityPubUrl(video),
attributedTo: [
{
type: 'Person',