From a3b472a12ec6e57dbe2f650419f8064864686eab Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 Aug 2022 11:51:13 +0200 Subject: Add ability to list imports of a channel sync --- shared/server-commands/videos/channels-command.ts | 10 +++++----- shared/server-commands/videos/imports-command.ts | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'shared/server-commands/videos') diff --git a/shared/server-commands/videos/channels-command.ts b/shared/server-commands/videos/channels-command.ts index a688a120f..385d0fe73 100644 --- a/shared/server-commands/videos/channels-command.ts +++ b/shared/server-commands/videos/channels-command.ts @@ -6,7 +6,8 @@ import { VideoChannel, VideoChannelCreate, VideoChannelCreateResult, - VideoChannelUpdate + VideoChannelUpdate, + VideosImportInChannelCreate } from '@shared/models' import { unwrapBody } from '../requests' import { AbstractCommand, OverrideCommandOptions } from '../shared' @@ -182,11 +183,10 @@ export class ChannelsCommand extends AbstractCommand { }) } - importVideos (options: OverrideCommandOptions & { + importVideos (options: OverrideCommandOptions & VideosImportInChannelCreate & { channelName: string - externalChannelUrl: string }) { - const { channelName, externalChannelUrl } = options + const { channelName, externalChannelUrl, videoChannelSyncId } = options const path = `/api/v1/video-channels/${channelName}/import-videos` @@ -194,7 +194,7 @@ export class ChannelsCommand extends AbstractCommand { ...options, path, - fields: { externalChannelUrl }, + fields: { externalChannelUrl, videoChannelSyncId }, implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) diff --git a/shared/server-commands/videos/imports-command.ts b/shared/server-commands/videos/imports-command.ts index c931ac481..07d810ec1 100644 --- a/shared/server-commands/videos/imports-command.ts +++ b/shared/server-commands/videos/imports-command.ts @@ -57,15 +57,17 @@ export class ImportsCommand extends AbstractCommand { getMyVideoImports (options: OverrideCommandOptions & { sort?: string targetUrl?: string + videoChannelSyncId?: number + search?: string } = {}) { - const { sort, targetUrl } = options + const { sort, targetUrl, videoChannelSyncId, search } = options const path = '/api/v1/users/me/videos/imports' return this.getRequestBody>({ ...options, path, - query: { sort, targetUrl }, + query: { sort, targetUrl, videoChannelSyncId, search }, implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) -- cgit v1.2.3