From b5fecbf44192144d1ca27c23a0b53922de288c10 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 21 Aug 2019 14:31:57 +0200 Subject: Type toActivityPubObject functions --- server/controllers/activitypub/client.ts | 4 ++-- server/controllers/api/video-channel.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index 98f5c8865..453ced8bf 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts @@ -214,7 +214,7 @@ async function videoController (req: express.Request, res: express.Response) { // We need captions to render AP object const captions = await VideoCaptionModel.listVideoCaptions(video.id) - const videoWithCaptions: MVideoAPWithoutCaption = Object.assign(video, { VideoCaptions: captions }) + const videoWithCaptions = Object.assign(video, { VideoCaptions: captions }) const audience = getAudience(videoWithCaptions.VideoChannel.Account.Actor, videoWithCaptions.privacy === VideoPrivacy.PUBLIC) const videoObject = audiencify(videoWithCaptions.toActivityPubObject(), audience) @@ -351,7 +351,7 @@ async function videoPlaylistController (req: express.Request, res: express.Respo } async function videoPlaylistElementController (req: express.Request, res: express.Response) { - const videoPlaylistElement = res.locals.videoPlaylistElement + const videoPlaylistElement = res.locals.videoPlaylistElementAP const json = videoPlaylistElement.toActivityPubObject() return activityPubResponse(activityPubContextify(json), res) diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index d4ca7a0af..acc5b2987 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts @@ -35,6 +35,7 @@ import { VideoPlaylistModel } from '../../models/video/video-playlist' import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists' import { CONFIG } from '../../initializers/config' import { sequelizeTypescript } from '../../initializers/database' +import { MChannelAccountDefault } from '@server/typings/models' const auditLogger = auditLoggerFactory('channels') const reqAvatarFile = createReqFiles([ 'avatarfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { avatarfile: CONFIG.STORAGE.TMP_DIR }) @@ -181,7 +182,7 @@ async function updateVideoChannel (req: express.Request, res: express.Response) } } - const videoChannelInstanceUpdated = await videoChannelInstance.save(sequelizeOptions) + const videoChannelInstanceUpdated = await videoChannelInstance.save(sequelizeOptions) as MChannelAccountDefault await sendUpdateActor(videoChannelInstanceUpdated, t) auditLogger.update( -- cgit v1.2.3