language?: string
nsfw?: boolean
commentsEnabled?: boolean
+ waitTranscoding?: boolean
description?: string
tags?: string[]
channelId?: number
fixture?: string
thumbnailfile?: string
previewfile?: string
+ scheduleUpdate?: {
+ updateAt: string
+ privacy?: VideoPrivacy
+ }
}
function getVideoCategories (url: string) {
}
function searchVideo (url: string, search: string) {
- const path = '/api/v1/videos'
+ const path = '/api/v1/search/videos'
const req = request(url)
- .get(path + '/search')
+ .get(path)
.query({ search })
.set('Accept', 'application/json')
}
function searchVideoWithPagination (url: string, search: string, start: number, count: number, sort?: string) {
- const path = '/api/v1/videos'
+ const path = '/api/v1/search/videos'
const req = request(url)
- .get(path + '/search')
+ .get(path)
.query({ start })
.query({ search })
.query({ count })
}
function searchVideoWithSort (url: string, search: string, sort: string) {
- const path = '/api/v1/videos'
+ const path = '/api/v1/search/videos'
return request(url)
- .get(path + '/search')
+ .get(path)
.query({ search })
.query({ sort })
.set('Accept', 'application/json')
async function checkVideoFilesWereRemoved (videoUUID: string, serverNumber: number) {
const testDirectory = 'test' + serverNumber
- for (const directory of [ 'videos', 'thumbnails', 'torrents', 'previews' ]) {
+ for (const directory of [ 'videos', 'thumbnails', 'torrents', 'previews', 'captions' ]) {
const directoryPath = join(root(), testDirectory, directory)
const directoryExists = existsSync(directoryPath)
language: 'zh',
channelId: defaultChannelId,
nsfw: true,
+ waitTranscoding: false,
description: 'my super description',
support: 'my super support text',
tags: [ 'tag' ],
.field('name', attributes.name)
.field('nsfw', JSON.stringify(attributes.nsfw))
.field('commentsEnabled', JSON.stringify(attributes.commentsEnabled))
+ .field('waitTranscoding', JSON.stringify(attributes.waitTranscoding))
.field('privacy', attributes.privacy.toString())
.field('channelId', attributes.channelId)
req.attach('previewfile', buildAbsoluteFixturePath(attributes.previewfile))
}
+ if (attributes.scheduleUpdate) {
+ req.field('scheduleUpdate[updateAt]', attributes.scheduleUpdate.updateAt)
+
+ if (attributes.scheduleUpdate.privacy) {
+ req.field('scheduleUpdate[privacy]', attributes.scheduleUpdate.privacy)
+ }
+ }
+
return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture))
.expect(specialStatus)
}
if (attributes.tags) body['tags'] = attributes.tags
if (attributes.privacy) body['privacy'] = attributes.privacy
if (attributes.channelId) body['channelId'] = attributes.channelId
+ if (attributes.scheduleUpdate) body['scheduleUpdate'] = attributes.scheduleUpdate
// Upload request
if (attributes.thumbnailfile || attributes.previewfile) {
nsfw: boolean
commentsEnabled: boolean
description: string
+ publishedAt?: string
support: string
account: {
name: string
expect(dateIsValid(video.publishedAt)).to.be.true
expect(dateIsValid(video.updatedAt)).to.be.true
+ if (attributes.publishedAt) {
+ expect(video.publishedAt).to.equal(attributes.publishedAt)
+ }
+
const res = await getVideo(url, video.uuid)
const videoDetails: VideoDetails = res.body