From 7d14d4d2ca82cc43c93b45bb1f90af975cfbf67c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 31 May 2019 16:30:11 +0200 Subject: Server: Bulk update videos support field --- shared/extra-utils/videos/video-channels.ts | 9 +++++---- shared/extra-utils/videos/videos.ts | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'shared/extra-utils/videos') diff --git a/shared/extra-utils/videos/video-channels.ts b/shared/extra-utils/videos/video-channels.ts index b4755b486..3e79cf15a 100644 --- a/shared/extra-utils/videos/video-channels.ts +++ b/shared/extra-utils/videos/video-channels.ts @@ -74,12 +74,13 @@ function updateVideoChannel ( attributes: VideoChannelUpdate, expectedStatus = 204 ) { - const body = {} + const body: any = {} const path = '/api/v1/video-channels/' + channelName - if (attributes.displayName) body['displayName'] = attributes.displayName - if (attributes.description) body['description'] = attributes.description - if (attributes.support) body['support'] = attributes.support + if (attributes.displayName) body.displayName = attributes.displayName + if (attributes.description) body.description = attributes.description + if (attributes.support) body.support = attributes.support + if (attributes.bulkVideosSupportUpdate) body.bulkVideosSupportUpdate = attributes.bulkVideosSupportUpdate return request(url) .put(path) diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts index a4ca43f26..debaaf9a7 100644 --- a/shared/extra-utils/videos/videos.ts +++ b/shared/extra-utils/videos/videos.ts @@ -355,6 +355,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg .set('Accept', 'application/json') .set('Authorization', 'Bearer ' + accessToken) .field('name', attributes.name) + .field('support', attributes.support) .field('nsfw', JSON.stringify(attributes.nsfw)) .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled)) .field('downloadEnabled', JSON.stringify(attributes.downloadEnabled)) -- cgit v1.2.3