aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/share.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-12 17:53:50 +0100
committerChocobozzz <me@florianbigard.com>2017-12-13 16:50:33 +0100
commit3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch)
treee5ca358287fca6ecacce83defcf23af1e8e9f419 /server/lib/activitypub/share.ts
parentc893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff)
downloadPeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.gz
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.zst
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.zip
Move models to typescript-sequelize
Diffstat (limited to 'server/lib/activitypub/share.ts')
-rw-r--r--server/lib/activitypub/share.ts19
1 files changed, 10 insertions, 9 deletions
diff --git a/server/lib/activitypub/share.ts b/server/lib/activitypub/share.ts
index e14b0f50c..5bec61c05 100644
--- a/server/lib/activitypub/share.ts
+++ b/server/lib/activitypub/share.ts
@@ -1,14 +1,15 @@
1import { Transaction } from 'sequelize' 1import { Transaction } from 'sequelize'
2import { getServerAccount } from '../../helpers/utils' 2import { getServerAccount } from '../../helpers'
3import { database as db } from '../../initializers' 3import { VideoModel } from '../../models/video/video'
4import { VideoChannelInstance } from '../../models/index' 4import { VideoChannelModel } from '../../models/video/video-channel'
5import { VideoInstance } from '../../models/video/video-interface' 5import { VideoChannelShareModel } from '../../models/video/video-channel-share'
6import { sendVideoAnnounceToFollowers, sendVideoChannelAnnounceToFollowers } from './send/send-announce' 6import { VideoShareModel } from '../../models/video/video-share'
7import { sendVideoAnnounceToFollowers, sendVideoChannelAnnounceToFollowers } from './send'
7 8
8async function shareVideoChannelByServer (videoChannel: VideoChannelInstance, t: Transaction) { 9async function shareVideoChannelByServer (videoChannel: VideoChannelModel, t: Transaction) {
9 const serverAccount = await getServerAccount() 10 const serverAccount = await getServerAccount()
10 11
11 await db.VideoChannelShare.create({ 12 await VideoChannelShareModel.create({
12 accountId: serverAccount.id, 13 accountId: serverAccount.id,
13 videoChannelId: videoChannel.id 14 videoChannelId: videoChannel.id
14 }, { transaction: t }) 15 }, { transaction: t })
@@ -16,10 +17,10 @@ async function shareVideoChannelByServer (videoChannel: VideoChannelInstance, t:
16 return sendVideoChannelAnnounceToFollowers(serverAccount, videoChannel, t) 17 return sendVideoChannelAnnounceToFollowers(serverAccount, videoChannel, t)
17} 18}
18 19
19async function shareVideoByServer (video: VideoInstance, t: Transaction) { 20async function shareVideoByServer (video: VideoModel, t: Transaction) {
20 const serverAccount = await getServerAccount() 21 const serverAccount = await getServerAccount()
21 22
22 await db.VideoShare.create({ 23 await VideoShareModel.create({
23 accountId: serverAccount.id, 24 accountId: serverAccount.id,
24 videoId: video.id 25 videoId: video.id
25 }, { transaction: t }) 26 }, { transaction: t })