From a5cf76afa378aae81af2a9b0ce548e5d2582f832 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 25 Sep 2020 10:04:21 +0200 Subject: Add watch messages if live has not started --- server/lib/activitypub/videos.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/lib/activitypub') diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 049e06cff..ab23ff507 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts @@ -66,6 +66,7 @@ import { FilteredModelAttributes } from '../../types/sequelize' import { ActorFollowScoreCache } from '../files-cache' import { JobQueue } from '../job-queue' import { Notifier } from '../notifier' +import { PeerTubeSocket } from '../peertube-socket' import { createPlaceholderThumbnail, createVideoMiniatureFromUrl } from '../thumbnail' import { setVideoTags } from '../video' import { autoBlacklistVideoIfNeeded } from '../video-blacklist' @@ -348,6 +349,7 @@ async function updateVideoFromAP (options: { video.privacy = videoData.privacy video.channelId = videoData.channelId video.views = videoData.views + video.isLive = videoData.isLive const videoUpdated = await video.save(sequelizeOptions) as MVideoFullLight @@ -434,6 +436,7 @@ async function updateVideoFromAP (options: { }) if (wasPrivateVideo || wasUnlistedVideo) Notifier.Instance.notifyOnNewVideoIfNeeded(videoUpdated) // Notify our users? + if (videoUpdated.isLive) PeerTubeSocket.Instance.sendVideoLiveNewState(video) logger.info('Remote video with uuid %s updated', videoObject.uuid) -- cgit v1.2.3