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:
parent
0567049a98
commit
a3b472a12e
37 changed files with 565 additions and 179 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue