aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 19:05:31 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 19:23:10 +0200
commit1ca9f7c3f7afac2af4c4c25b98426731f7e789c6 (patch)
tree27fe65c4ea5e9250d2523033d5c65b315bfca23d /server/lib/video-channel.ts
parent0283eaac2a8e73006c66df3cf5bb9012e37450e5 (diff)
downloadPeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.gz
PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.tar.zst
PeerTube-1ca9f7c3f7afac2af4c4c25b98426731f7e789c6.zip
Type toFormattedJSON
Diffstat (limited to 'server/lib/video-channel.ts')
-rw-r--r--server/lib/video-channel.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/video-channel.ts b/server/lib/video-channel.ts
index ee8eb6568..41eab456b 100644
--- a/server/lib/video-channel.ts
+++ b/server/lib/video-channel.ts
@@ -4,12 +4,12 @@ import { VideoChannelCreate } from '../../shared/models'
4import { VideoChannelModel } from '../models/video/video-channel' 4import { VideoChannelModel } from '../models/video/video-channel'
5import { buildActorInstance, federateVideoIfNeeded, getVideoChannelActivityPubUrl } from './activitypub' 5import { buildActorInstance, federateVideoIfNeeded, getVideoChannelActivityPubUrl } from './activitypub'
6import { VideoModel } from '../models/video/video' 6import { VideoModel } from '../models/video/video'
7import { MAccountId, MChannelActor, MChannelId } from '../typings/models' 7import { MAccountId, MChannelDefault, MChannelId } from '../typings/models'
8 8
9type CustomVideoChannelModelAccount <T extends MAccountId> = MChannelActor & 9type CustomVideoChannelModelAccount <T extends MAccountId> = MChannelDefault &
10 { Account?: T } 10 { Account?: T }
11 11
12async function createVideoChannel <T extends MAccountId> ( 12async function createLocalVideoChannel <T extends MAccountId> (
13 videoChannelInfo: VideoChannelCreate, 13 videoChannelInfo: VideoChannelCreate,
14 account: T, 14 account: T,
15 t: Sequelize.Transaction 15 t: Sequelize.Transaction
@@ -31,7 +31,7 @@ async function createVideoChannel <T extends MAccountId> (
31 const videoChannel = new VideoChannelModel(videoChannelData) 31 const videoChannel = new VideoChannelModel(videoChannelData)
32 32
33 const options = { transaction: t } 33 const options = { transaction: t }
34 const videoChannelCreated: CustomVideoChannelModelAccount<T> = await videoChannel.save(options) as MChannelActor 34 const videoChannelCreated: CustomVideoChannelModelAccount<T> = await videoChannel.save(options) as MChannelDefault
35 35
36 // Do not forget to add Account/Actor information to the created video channel 36 // Do not forget to add Account/Actor information to the created video channel
37 videoChannelCreated.Account = account 37 videoChannelCreated.Account = account
@@ -54,6 +54,6 @@ async function federateAllVideosOfChannel (videoChannel: MChannelId) {
54// --------------------------------------------------------------------------- 54// ---------------------------------------------------------------------------
55 55
56export { 56export {
57 createVideoChannel, 57 createLocalVideoChannel,
58 federateAllVideosOfChannel 58 federateAllVideosOfChannel
59} 59}