From 2cb03dc1f4e01ba491c36caff30c33fe9c5bad89 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Apr 2021 17:01:35 +0200 Subject: Add banners support --- server/lib/video-channel.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'server/lib/video-channel.ts') diff --git a/server/lib/video-channel.ts b/server/lib/video-channel.ts index 49bdf4869..0476cb2d5 100644 --- a/server/lib/video-channel.ts +++ b/server/lib/video-channel.ts @@ -3,18 +3,12 @@ import { v4 as uuidv4 } from 'uuid' import { VideoChannelCreate } from '../../shared/models' import { VideoModel } from '../models/video/video' import { VideoChannelModel } from '../models/video/video-channel' -import { MAccountId, MChannelDefault, MChannelId } from '../types/models' +import { MAccountId, MChannelId } from '../types/models' import { buildActorInstance } from './activitypub/actor' import { getLocalVideoChannelActivityPubUrl } from './activitypub/url' import { federateVideoIfNeeded } from './activitypub/videos' -type CustomVideoChannelModelAccount = MChannelDefault & { Account?: T } - -async function createLocalVideoChannel ( - videoChannelInfo: VideoChannelCreate, - account: T, - t: Sequelize.Transaction -): Promise> { +async function createLocalVideoChannel (videoChannelInfo: VideoChannelCreate, account: MAccountId, t: Sequelize.Transaction) { const uuid = uuidv4() const url = getLocalVideoChannelActivityPubUrl(videoChannelInfo.name) const actorInstance = buildActorInstance('Group', url, videoChannelInfo.name, uuid) @@ -32,13 +26,11 @@ async function createLocalVideoChannel ( const videoChannel = new VideoChannelModel(videoChannelData) const options = { transaction: t } - const videoChannelCreated: CustomVideoChannelModelAccount = await videoChannel.save(options) as MChannelDefault + const videoChannelCreated = await videoChannel.save(options) - // Do not forget to add Account/Actor information to the created video channel - videoChannelCreated.Account = account videoChannelCreated.Actor = actorInstanceCreated - // No need to seed this empty video channel to followers + // No need to send this empty video channel to followers return videoChannelCreated } -- cgit v1.2.3