From cef534ed53e4518fe0acf581bfe880788d42fc36 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Dec 2018 10:36:24 +0100 Subject: Add user notification base code --- server/lib/schedulers/update-videos-scheduler.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/lib/schedulers') diff --git a/server/lib/schedulers/update-videos-scheduler.ts b/server/lib/schedulers/update-videos-scheduler.ts index 21f071f9e..b7fb029f1 100644 --- a/server/lib/schedulers/update-videos-scheduler.ts +++ b/server/lib/schedulers/update-videos-scheduler.ts @@ -5,6 +5,7 @@ import { retryTransactionWrapper } from '../../helpers/database-utils' import { federateVideoIfNeeded } from '../activitypub' import { SCHEDULER_INTERVALS_MS, sequelizeTypescript } from '../../initializers' import { VideoPrivacy } from '../../../shared/models/videos' +import { Notifier } from '../notifier' export class UpdateVideosScheduler extends AbstractScheduler { @@ -39,6 +40,10 @@ export class UpdateVideosScheduler extends AbstractScheduler { await video.save({ transaction: t }) await federateVideoIfNeeded(video, isNewVideo, t) + + if (oldPrivacy === VideoPrivacy.UNLISTED || oldPrivacy === VideoPrivacy.PRIVATE) { + Notifier.Instance.notifyOnNewVideo(video) + } } await schedule.destroy({ transaction: t }) -- cgit v1.2.3