1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Add dirty migration :/

This commit is contained in:
Chocobozzz 2017-12-15 17:34:38 +01:00
parent 50d6de9c28
commit a7d647c440
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 259 additions and 10 deletions

View file

@ -4,17 +4,27 @@ import { VideoModel } from '../../models/video/video'
import { VideoShareModel } from '../../models/video/video-share'
import { sendVideoAnnounceToFollowers } from './send'
async function shareVideoByServer (video: VideoModel, t: Transaction) {
async function shareVideoByServerAndChannel (video: VideoModel, t: Transaction) {
const serverActor = await getServerActor()
await VideoShareModel.create({
const serverShare = VideoShareModel.create({
actorId: serverActor.id,
videoId: video.id
}, { transaction: t })
const videoChannelShare = VideoShareModel.create({
actorId: video.VideoChannel.actorId,
videoId: video.id
}, { transaction: t })
await Promise.all([
serverShare,
videoChannelShare
])
return sendVideoAnnounceToFollowers(serverActor, video, t)
}
export {
shareVideoByServer
shareVideoByServerAndChannel
}