VideoFileMetadata,
VideoPrivacy,
VideosCommonQuery,
- VideosWithSearchCommonQuery
+ VideoTranscodingCreate
} from '@shared/models'
import { buildAbsoluteFixturePath, wait } from '../miscs'
import { unwrapBody } from '../requests'
})
}
- listByAccount (options: OverrideCommandOptions & VideosWithSearchCommonQuery & {
+ listByAccount (options: OverrideCommandOptions & VideosCommonQuery & {
handle: string
}) {
const { handle, search } = options
})
}
- listByChannel (options: OverrideCommandOptions & VideosWithSearchCommonQuery & {
+ listByChannel (options: OverrideCommandOptions & VideosCommonQuery & {
handle: string
}) {
const { handle } = options
attributes: VideoEdit
size: number
mimetype: string
+
+ originalName?: string
+ lastModified?: number
}) {
- const { attributes, size, mimetype } = options
+ const { attributes, originalName, lastModified, size, mimetype } = options
const path = '/api/v1/videos/upload-resumable'
'X-Upload-Content-Type': mimetype,
'X-Upload-Content-Length': size.toString()
},
- fields: { filename: attributes.fixture, ...this.buildUploadFields(options.attributes) },
+ fields: {
+ filename: attributes.fixture,
+ originalName,
+ lastModified,
+
+ ...this.buildUploadFields(options.attributes)
+ },
+
// Fixture will be sent later
attaches: this.buildUploadAttaches(omit(options.attributes, 'fixture')),
implicitToken: true,
// ---------------------------------------------------------------------------
+ removeHLSFiles (options: OverrideCommandOptions & {
+ videoId: number | string
+ }) {
+ const path = '/api/v1/videos/' + options.videoId + '/hls'
+
+ return this.deleteRequest({
+ ...options,
+
+ path,
+ implicitToken: true,
+ defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
+ })
+ }
+
+ removeWebTorrentFiles (options: OverrideCommandOptions & {
+ videoId: number | string
+ }) {
+ const path = '/api/v1/videos/' + options.videoId + '/webtorrent'
+
+ return this.deleteRequest({
+ ...options,
+
+ path,
+ implicitToken: true,
+ defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
+ })
+ }
+
+ runTranscoding (options: OverrideCommandOptions & {
+ videoId: number | string
+ transcodingType: 'hls' | 'webtorrent'
+ }) {
+ const path = '/api/v1/videos/' + options.videoId + '/transcoding'
+
+ const fields: VideoTranscodingCreate = pick(options, [ 'transcodingType' ])
+
+ return this.postBodyRequest({
+ ...options,
+
+ path,
+ fields,
+ implicitToken: true,
+ defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
+ })
+ }
+
+ // ---------------------------------------------------------------------------
+
private buildListQuery (options: VideosCommonQuery) {
return pick(options, [
'start',
'languageOneOf',
'tagsOneOf',
'tagsAllOf',
- 'filter',
+ 'isLocal',
+ 'include',
'skipCount'
])
}