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:
parent
50d6de9c28
commit
a7d647c440
5 changed files with 259 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue