1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Add ability to list imports of a channel sync

This commit is contained in:
Chocobozzz 2022-08-10 11:51:13 +02:00
parent 0567049a98
commit a3b472a12e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
37 changed files with 565 additions and 179 deletions

View file

@ -2,7 +2,7 @@ import { ChildProcess, fork } from 'child_process'
import { copy } from 'fs-extra'
import { join } from 'path'
import { parallelTests, randomInt, root } from '@shared/core-utils'
import { Video, VideoChannel, VideoCreateResult, VideoDetails } from '@shared/models'
import { Video, VideoChannel, VideoChannelSync, VideoCreateResult, VideoDetails } from '@shared/models'
import { BulkCommand } from '../bulk'
import { CLICommand } from '../cli'
import { CustomPagesCommand } from '../custom-pages'
@ -80,6 +80,7 @@ export class PeerTubeServer {
}
channel?: VideoChannel
videoChannelSync?: Partial<VideoChannelSync>
video?: Video
videoCreated?: VideoCreateResult

View file

@ -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
})

View file

@ -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<ResultList<VideoImport>>({
...options,
path,
query: { sort, targetUrl },
query: { sort, targetUrl, videoChannelSyncId, search },
implicitToken: true,
defaultExpectedStatus: HttpStatusCode.OK_200
})