Rename downloadingEnabled property to downloadEnabled
This commit is contained in:
parent
4ffdcfc63b
commit
7f2cfe3a79
|
@ -81,7 +81,7 @@ export class VideoImportService {
|
||||||
nsfw: video.nsfw,
|
nsfw: video.nsfw,
|
||||||
waitTranscoding: video.waitTranscoding,
|
waitTranscoding: video.waitTranscoding,
|
||||||
commentsEnabled: video.commentsEnabled,
|
commentsEnabled: video.commentsEnabled,
|
||||||
downloadingEnabled: video.downloadingEnabled,
|
downloadEnabled: video.downloadEnabled,
|
||||||
thumbnailfile: video.thumbnailfile,
|
thumbnailfile: video.thumbnailfile,
|
||||||
previewfile: video.previewfile,
|
previewfile: video.previewfile,
|
||||||
scheduleUpdate
|
scheduleUpdate
|
||||||
|
|
|
@ -12,7 +12,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
|
||||||
files: VideoFile[]
|
files: VideoFile[]
|
||||||
account: Account
|
account: Account
|
||||||
commentsEnabled: boolean
|
commentsEnabled: boolean
|
||||||
downloadingEnabled: boolean
|
downloadEnabled: boolean
|
||||||
|
|
||||||
waitTranscoding: boolean
|
waitTranscoding: boolean
|
||||||
state: VideoConstant<VideoState>
|
state: VideoConstant<VideoState>
|
||||||
|
@ -30,7 +30,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
|
||||||
this.tags = hash.tags
|
this.tags = hash.tags
|
||||||
this.support = hash.support
|
this.support = hash.support
|
||||||
this.commentsEnabled = hash.commentsEnabled
|
this.commentsEnabled = hash.commentsEnabled
|
||||||
this.downloadingEnabled = hash.downloadingEnabled
|
this.downloadEnabled = hash.downloadEnabled
|
||||||
|
|
||||||
this.buildLikeAndDislikePercents()
|
this.buildLikeAndDislikePercents()
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export class VideoEdit implements VideoUpdate {
|
||||||
tags: string[]
|
tags: string[]
|
||||||
nsfw: boolean
|
nsfw: boolean
|
||||||
commentsEnabled: boolean
|
commentsEnabled: boolean
|
||||||
downloadingEnabled: boolean
|
downloadEnabled: boolean
|
||||||
waitTranscoding: boolean
|
waitTranscoding: boolean
|
||||||
channelId: number
|
channelId: number
|
||||||
privacy: VideoPrivacy
|
privacy: VideoPrivacy
|
||||||
|
@ -27,7 +27,7 @@ export class VideoEdit implements VideoUpdate {
|
||||||
id?: number
|
id?: number
|
||||||
scheduleUpdate?: VideoScheduleUpdate
|
scheduleUpdate?: VideoScheduleUpdate
|
||||||
|
|
||||||
constructor (video?: Video & { tags: string[], commentsEnabled: boolean, downloadingEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {
|
constructor (video?: Video & { tags: string[], commentsEnabled: boolean, downloadEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {
|
||||||
if (video) {
|
if (video) {
|
||||||
this.id = video.id
|
this.id = video.id
|
||||||
this.uuid = video.uuid
|
this.uuid = video.uuid
|
||||||
|
@ -39,7 +39,7 @@ export class VideoEdit implements VideoUpdate {
|
||||||
this.tags = video.tags
|
this.tags = video.tags
|
||||||
this.nsfw = video.nsfw
|
this.nsfw = video.nsfw
|
||||||
this.commentsEnabled = video.commentsEnabled
|
this.commentsEnabled = video.commentsEnabled
|
||||||
this.downloadingEnabled = video.downloadingEnabled
|
this.downloadEnabled = video.downloadEnabled
|
||||||
this.waitTranscoding = video.waitTranscoding
|
this.waitTranscoding = video.waitTranscoding
|
||||||
this.channelId = video.channel.id
|
this.channelId = video.channel.id
|
||||||
this.privacy = video.privacy.id
|
this.privacy = video.privacy.id
|
||||||
|
@ -82,7 +82,7 @@ export class VideoEdit implements VideoUpdate {
|
||||||
tags: this.tags,
|
tags: this.tags,
|
||||||
nsfw: this.nsfw,
|
nsfw: this.nsfw,
|
||||||
commentsEnabled: this.commentsEnabled,
|
commentsEnabled: this.commentsEnabled,
|
||||||
downloadingEnabled: this.downloadingEnabled,
|
downloadEnabled: this.downloadEnabled,
|
||||||
waitTranscoding: this.waitTranscoding,
|
waitTranscoding: this.waitTranscoding,
|
||||||
channelId: this.channelId,
|
channelId: this.channelId,
|
||||||
privacy: this.privacy
|
privacy: this.privacy
|
||||||
|
|
|
@ -95,7 +95,7 @@ export class VideoService implements VideosProvider {
|
||||||
nsfw: video.nsfw,
|
nsfw: video.nsfw,
|
||||||
waitTranscoding: video.waitTranscoding,
|
waitTranscoding: video.waitTranscoding,
|
||||||
commentsEnabled: video.commentsEnabled,
|
commentsEnabled: video.commentsEnabled,
|
||||||
downloadingEnabled: video.downloadingEnabled,
|
downloadEnabled: video.downloadEnabled,
|
||||||
thumbnailfile: video.thumbnailfile,
|
thumbnailfile: video.thumbnailfile,
|
||||||
previewfile: video.previewfile,
|
previewfile: video.previewfile,
|
||||||
scheduleUpdate
|
scheduleUpdate
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
></my-peertube-checkbox>
|
></my-peertube-checkbox>
|
||||||
|
|
||||||
<my-peertube-checkbox
|
<my-peertube-checkbox
|
||||||
inputName="downloadingEnabled" formControlName="downloadingEnabled"
|
inputName="downloadEnabled" formControlName="downloadEnabled"
|
||||||
i18n-labelText labelText="Disable downloading"
|
i18n-labelText labelText="Disable downloading"
|
||||||
></my-peertube-checkbox>
|
></my-peertube-checkbox>
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
nsfw: 'false',
|
nsfw: 'false',
|
||||||
commentsEnabled: 'true',
|
commentsEnabled: 'true',
|
||||||
downloadingEnabled: 'true',
|
downloadEnabled: 'true',
|
||||||
waitTranscoding: 'true',
|
waitTranscoding: 'true',
|
||||||
tags: []
|
tags: []
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
|
||||||
channelId: this.videoValidatorsService.VIDEO_CHANNEL,
|
channelId: this.videoValidatorsService.VIDEO_CHANNEL,
|
||||||
nsfw: null,
|
nsfw: null,
|
||||||
commentsEnabled: null,
|
commentsEnabled: null,
|
||||||
downloadingEnabled: null,
|
downloadEnabled: null,
|
||||||
waitTranscoding: null,
|
waitTranscoding: null,
|
||||||
category: this.videoValidatorsService.VIDEO_CATEGORY,
|
category: this.videoValidatorsService.VIDEO_CATEGORY,
|
||||||
licence: this.videoValidatorsService.VIDEO_LICENCE,
|
licence: this.videoValidatorsService.VIDEO_LICENCE,
|
||||||
|
|
|
@ -77,7 +77,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca
|
||||||
privacy: this.firstStepPrivacyId,
|
privacy: this.firstStepPrivacyId,
|
||||||
waitTranscoding: false,
|
waitTranscoding: false,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
channelId: this.firstStepChannelId
|
channelId: this.firstStepChannelId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca
|
||||||
|
|
||||||
this.video = new VideoEdit(Object.assign(res.video, {
|
this.video = new VideoEdit(Object.assign(res.video, {
|
||||||
commentsEnabled: videoUpdate.commentsEnabled,
|
commentsEnabled: videoUpdate.commentsEnabled,
|
||||||
downloadingEnabled: videoUpdate.downloadingEnabled,
|
downloadEnabled: videoUpdate.downloadEnabled,
|
||||||
support: null,
|
support: null,
|
||||||
thumbnailUrl: null,
|
thumbnailUrl: null,
|
||||||
previewUrl: null
|
previewUrl: null
|
||||||
|
|
|
@ -69,7 +69,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
|
||||||
privacy: this.firstStepPrivacyId,
|
privacy: this.firstStepPrivacyId,
|
||||||
waitTranscoding: false,
|
waitTranscoding: false,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
channelId: this.firstStepChannelId
|
channelId: this.firstStepChannelId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
|
||||||
|
|
||||||
this.video = new VideoEdit(Object.assign(res.video, {
|
this.video = new VideoEdit(Object.assign(res.video, {
|
||||||
commentsEnabled: videoUpdate.commentsEnabled,
|
commentsEnabled: videoUpdate.commentsEnabled,
|
||||||
downloadingEnabled: videoUpdate.downloadingEnabled,
|
downloadEnabled: videoUpdate.downloadEnabled,
|
||||||
support: null,
|
support: null,
|
||||||
thumbnailUrl: null,
|
thumbnailUrl: null,
|
||||||
previewUrl: null
|
previewUrl: null
|
||||||
|
|
|
@ -159,7 +159,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
|
||||||
const nsfw = false
|
const nsfw = false
|
||||||
const waitTranscoding = true
|
const waitTranscoding = true
|
||||||
const commentsEnabled = true
|
const commentsEnabled = true
|
||||||
const downloadingEnabled = true
|
const downloadEnabled = true
|
||||||
const channelId = this.firstStepChannelId.toString()
|
const channelId = this.firstStepChannelId.toString()
|
||||||
|
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
|
@ -168,7 +168,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
|
||||||
formData.append('privacy', VideoPrivacy.PRIVATE.toString())
|
formData.append('privacy', VideoPrivacy.PRIVATE.toString())
|
||||||
formData.append('nsfw', '' + nsfw)
|
formData.append('nsfw', '' + nsfw)
|
||||||
formData.append('commentsEnabled', '' + commentsEnabled)
|
formData.append('commentsEnabled', '' + commentsEnabled)
|
||||||
formData.append('downloadingEnabled', '' + downloadingEnabled)
|
formData.append('downloadEnabled', '' + downloadEnabled)
|
||||||
formData.append('waitTranscoding', '' + waitTranscoding)
|
formData.append('waitTranscoding', '' + waitTranscoding)
|
||||||
formData.append('channelId', '' + channelId)
|
formData.append('channelId', '' + channelId)
|
||||||
formData.append('videofile', videofile)
|
formData.append('videofile', videofile)
|
||||||
|
|
|
@ -314,7 +314,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
isVideoDownloadable () {
|
isVideoDownloadable () {
|
||||||
return this.video && this.video.downloadingEnabled
|
return this.video && this.video.downloadEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
isVideoToImport () {
|
isVideoToImport () {
|
||||||
|
|
|
@ -171,7 +171,7 @@ function buildVideo (channelId: number, body: VideoImportCreate, importData: You
|
||||||
licence: body.licence || importData.licence,
|
licence: body.licence || importData.licence,
|
||||||
language: body.language || undefined,
|
language: body.language || undefined,
|
||||||
commentsEnabled: body.commentsEnabled || true,
|
commentsEnabled: body.commentsEnabled || true,
|
||||||
downloadingEnabled: body.downloadingEnabled || true,
|
downloadEnabled: body.downloadEnabled || true,
|
||||||
waitTranscoding: body.waitTranscoding || false,
|
waitTranscoding: body.waitTranscoding || false,
|
||||||
state: VideoState.TO_IMPORT,
|
state: VideoState.TO_IMPORT,
|
||||||
nsfw: body.nsfw || importData.nsfw || false,
|
nsfw: body.nsfw || importData.nsfw || false,
|
||||||
|
|
|
@ -179,7 +179,7 @@ async function addVideo (req: express.Request, res: express.Response) {
|
||||||
licence: videoInfo.licence,
|
licence: videoInfo.licence,
|
||||||
language: videoInfo.language,
|
language: videoInfo.language,
|
||||||
commentsEnabled: videoInfo.commentsEnabled || false,
|
commentsEnabled: videoInfo.commentsEnabled || false,
|
||||||
downloadingEnabled: videoInfo.downloadingEnabled || true,
|
downloadEnabled: videoInfo.downloadEnabled || true,
|
||||||
waitTranscoding: videoInfo.waitTranscoding || false,
|
waitTranscoding: videoInfo.waitTranscoding || false,
|
||||||
state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED,
|
state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED,
|
||||||
nsfw: videoInfo.nsfw || false,
|
nsfw: videoInfo.nsfw || false,
|
||||||
|
@ -323,7 +323,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
|
||||||
if (videoInfoToUpdate.support !== undefined) videoInstance.set('support', videoInfoToUpdate.support)
|
if (videoInfoToUpdate.support !== undefined) videoInstance.set('support', videoInfoToUpdate.support)
|
||||||
if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description)
|
if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description)
|
||||||
if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled)
|
if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled)
|
||||||
if (videoInfoToUpdate.downloadingEnabled !== undefined) videoInstance.set('downloadingEnabled', videoInfoToUpdate.downloadingEnabled)
|
if (videoInfoToUpdate.downloadEnabled !== undefined) videoInstance.set('downloadEnabled', videoInfoToUpdate.downloadEnabled)
|
||||||
if (videoInfoToUpdate.privacy !== undefined) {
|
if (videoInfoToUpdate.privacy !== undefined) {
|
||||||
const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10)
|
const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10)
|
||||||
videoInstance.set('privacy', newPrivacy)
|
videoInstance.set('privacy', newPrivacy)
|
||||||
|
|
|
@ -28,7 +28,7 @@ function activityPubContextify <T> (data: T) {
|
||||||
size: 'schema:Number',
|
size: 'schema:Number',
|
||||||
fps: 'schema:Number',
|
fps: 'schema:Number',
|
||||||
commentsEnabled: 'schema:Boolean',
|
commentsEnabled: 'schema:Boolean',
|
||||||
downloadingEnabled: 'schema:Boolean',
|
downloadEnabled: 'schema:Boolean',
|
||||||
waitTranscoding: 'schema:Boolean',
|
waitTranscoding: 'schema:Boolean',
|
||||||
expires: 'schema:expires',
|
expires: 'schema:expires',
|
||||||
support: 'schema:Text',
|
support: 'schema:Text',
|
||||||
|
|
|
@ -118,7 +118,7 @@ const videoKeysToKeep = [
|
||||||
'channel-name',
|
'channel-name',
|
||||||
'support',
|
'support',
|
||||||
'commentsEnabled',
|
'commentsEnabled',
|
||||||
'downloadingEnabled'
|
'downloadEnabled'
|
||||||
]
|
]
|
||||||
class VideoAuditView extends EntityAuditView {
|
class VideoAuditView extends EntityAuditView {
|
||||||
constructor (private video: VideoDetails) {
|
constructor (private video: VideoDetails) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
|
||||||
// Default attributes
|
// Default attributes
|
||||||
if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED
|
if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED
|
||||||
if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false
|
if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false
|
||||||
if (!isBooleanValid(video.downloadingEnabled)) video.downloadingEnabled = true
|
if (!isBooleanValid(video.downloadEnabled)) video.downloadEnabled = true
|
||||||
|
|
||||||
return isActivityPubUrlValid(video.id) &&
|
return isActivityPubUrlValid(video.id) &&
|
||||||
isVideoNameValid(video.name) &&
|
isVideoNameValid(video.name) &&
|
||||||
|
@ -68,7 +68,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
|
||||||
isVideoViewsValid(video.views) &&
|
isVideoViewsValid(video.views) &&
|
||||||
isBooleanValid(video.sensitive) &&
|
isBooleanValid(video.sensitive) &&
|
||||||
isBooleanValid(video.commentsEnabled) &&
|
isBooleanValid(video.commentsEnabled) &&
|
||||||
isBooleanValid(video.downloadingEnabled) &&
|
isBooleanValid(video.downloadEnabled) &&
|
||||||
isDateValid(video.published) &&
|
isDateValid(video.published) &&
|
||||||
isDateValid(video.updated) &&
|
isDateValid(video.updated) &&
|
||||||
(!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) &&
|
(!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) &&
|
||||||
|
|
|
@ -11,10 +11,10 @@ async function up (utils: {
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
defaultValue: true
|
defaultValue: true
|
||||||
} as Migration.Boolean
|
} as Migration.Boolean
|
||||||
await utils.queryInterface.addColumn('video', 'downloadingEnabled', data)
|
await utils.queryInterface.addColumn('video', 'downloadEnabled', data)
|
||||||
|
|
||||||
data.defaultValue = null
|
data.defaultValue = null
|
||||||
return utils.queryInterface.changeColumn('video', 'downloadingEnabled', data)
|
return utils.queryInterface.changeColumn('video', 'downloadEnabled', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
function down (options) {
|
function down (options) {
|
||||||
|
|
|
@ -230,7 +230,7 @@ async function updateVideoFromAP (options: {
|
||||||
options.video.set('support', videoData.support)
|
options.video.set('support', videoData.support)
|
||||||
options.video.set('nsfw', videoData.nsfw)
|
options.video.set('nsfw', videoData.nsfw)
|
||||||
options.video.set('commentsEnabled', videoData.commentsEnabled)
|
options.video.set('commentsEnabled', videoData.commentsEnabled)
|
||||||
options.video.set('downloadingEnabled', videoData.downloadingEnabled)
|
options.video.set('downloadEnabled', videoData.downloadEnabled)
|
||||||
options.video.set('waitTranscoding', videoData.waitTranscoding)
|
options.video.set('waitTranscoding', videoData.waitTranscoding)
|
||||||
options.video.set('state', videoData.state)
|
options.video.set('state', videoData.state)
|
||||||
options.video.set('duration', videoData.duration)
|
options.video.set('duration', videoData.duration)
|
||||||
|
@ -442,7 +442,7 @@ async function videoActivityObjectToDBAttributes (
|
||||||
support,
|
support,
|
||||||
nsfw: videoObject.sensitive,
|
nsfw: videoObject.sensitive,
|
||||||
commentsEnabled: videoObject.commentsEnabled,
|
commentsEnabled: videoObject.commentsEnabled,
|
||||||
downloadingEnabled: videoObject.downloadingEnabled,
|
downloadEnabled: videoObject.downloadEnabled,
|
||||||
waitTranscoding: videoObject.waitTranscoding,
|
waitTranscoding: videoObject.waitTranscoding,
|
||||||
state: videoObject.state,
|
state: videoObject.state,
|
||||||
channelId: videoChannel.id,
|
channelId: videoChannel.id,
|
||||||
|
|
|
@ -349,7 +349,7 @@ function getCommonVideoAttributes () {
|
||||||
.optional()
|
.optional()
|
||||||
.toBoolean()
|
.toBoolean()
|
||||||
.custom(isBooleanValid).withMessage('Should have comments enabled boolean'),
|
.custom(isBooleanValid).withMessage('Should have comments enabled boolean'),
|
||||||
body('downloadingEnabled')
|
body('downloadEnabled')
|
||||||
.optional()
|
.optional()
|
||||||
.toBoolean()
|
.toBoolean()
|
||||||
.custom(isBooleanValid).withMessage('Should have downloading enabled boolean'),
|
.custom(isBooleanValid).withMessage('Should have downloading enabled boolean'),
|
||||||
|
|
|
@ -128,7 +128,7 @@ function videoModelToFormattedDetailsJSON (video: VideoModel): VideoDetails {
|
||||||
account: video.VideoChannel.Account.toFormattedJSON(),
|
account: video.VideoChannel.Account.toFormattedJSON(),
|
||||||
tags,
|
tags,
|
||||||
commentsEnabled: video.commentsEnabled,
|
commentsEnabled: video.commentsEnabled,
|
||||||
downloadingEnabled: video.downloadingEnabled,
|
downloadEnabled: video.downloadEnabled,
|
||||||
waitTranscoding: video.waitTranscoding,
|
waitTranscoding: video.waitTranscoding,
|
||||||
state: {
|
state: {
|
||||||
id: video.state,
|
id: video.state,
|
||||||
|
@ -260,7 +260,7 @@ function videoModelToActivityPubObject (video: VideoModel): VideoTorrentObject {
|
||||||
waitTranscoding: video.waitTranscoding,
|
waitTranscoding: video.waitTranscoding,
|
||||||
state: video.state,
|
state: video.state,
|
||||||
commentsEnabled: video.commentsEnabled,
|
commentsEnabled: video.commentsEnabled,
|
||||||
downloadingEnabled: video.downloadingEnabled,
|
downloadEnabled: video.downloadEnabled,
|
||||||
published: video.publishedAt.toISOString(),
|
published: video.publishedAt.toISOString(),
|
||||||
updated: video.updatedAt.toISOString(),
|
updated: video.updatedAt.toISOString(),
|
||||||
mediaType: 'text/markdown',
|
mediaType: 'text/markdown',
|
||||||
|
|
|
@ -600,7 +600,7 @@ export class VideoModel extends Model<VideoModel> {
|
||||||
|
|
||||||
@AllowNull(false)
|
@AllowNull(false)
|
||||||
@Column
|
@Column
|
||||||
downloadingEnabled: boolean
|
downloadEnabled: boolean
|
||||||
|
|
||||||
@AllowNull(false)
|
@AllowNull(false)
|
||||||
@Column
|
@Column
|
||||||
|
|
|
@ -84,7 +84,7 @@ describe('Test video imports API validator', function () {
|
||||||
language: 'pt',
|
language: 'pt',
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
waitTranscoding: true,
|
waitTranscoding: true,
|
||||||
description: 'my super description',
|
description: 'my super description',
|
||||||
support: 'my super support text',
|
support: 'my super support text',
|
||||||
|
|
|
@ -175,7 +175,7 @@ describe('Test videos API validator', function () {
|
||||||
language: 'pt',
|
language: 'pt',
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
waitTranscoding: true,
|
waitTranscoding: true,
|
||||||
description: 'my super description',
|
description: 'my super description',
|
||||||
support: 'my super support text',
|
support: 'my super support text',
|
||||||
|
@ -420,7 +420,7 @@ describe('Test videos API validator', function () {
|
||||||
language: 'pt',
|
language: 'pt',
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
commentsEnabled: false,
|
commentsEnabled: false,
|
||||||
downloadingEnabled: false,
|
downloadEnabled: false,
|
||||||
description: 'my super description',
|
description: 'my super description',
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
tags: [ 'tag1', 'tag2' ]
|
tags: [ 'tag1', 'tag2' ]
|
||||||
|
|
|
@ -305,7 +305,7 @@ describe('Test follows', function () {
|
||||||
},
|
},
|
||||||
isLocal,
|
isLocal,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
duration: 5,
|
duration: 5,
|
||||||
tags: [ 'tag1', 'tag2', 'tag3' ],
|
tags: [ 'tag1', 'tag2', 'tag3' ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
|
|
|
@ -70,7 +70,7 @@ describe('Test handle downs', function () {
|
||||||
tags: [ 'tag1p1', 'tag2p1' ],
|
tags: [ 'tag1p1', 'tag2p1' ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
channel: {
|
channel: {
|
||||||
name: 'root_channel',
|
name: 'root_channel',
|
||||||
displayName: 'Main root channel',
|
displayName: 'Main root channel',
|
||||||
|
|
|
@ -127,7 +127,7 @@ describe('Test multiple servers', function () {
|
||||||
tags: [ 'tag1p1', 'tag2p1' ],
|
tags: [ 'tag1p1', 'tag2p1' ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
channel: {
|
channel: {
|
||||||
displayName: 'my channel',
|
displayName: 'my channel',
|
||||||
name: 'super_channel_name',
|
name: 'super_channel_name',
|
||||||
|
@ -199,7 +199,7 @@ describe('Test multiple servers', function () {
|
||||||
},
|
},
|
||||||
isLocal,
|
isLocal,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
duration: 5,
|
duration: 5,
|
||||||
tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ],
|
tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
|
@ -308,7 +308,7 @@ describe('Test multiple servers', function () {
|
||||||
isLocal,
|
isLocal,
|
||||||
duration: 5,
|
duration: 5,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
tags: [ 'tag1p3' ],
|
tags: [ 'tag1p3' ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
channel: {
|
channel: {
|
||||||
|
@ -340,7 +340,7 @@ describe('Test multiple servers', function () {
|
||||||
host: 'localhost:9003'
|
host: 'localhost:9003'
|
||||||
},
|
},
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
isLocal,
|
isLocal,
|
||||||
duration: 5,
|
duration: 5,
|
||||||
tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ],
|
tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ],
|
||||||
|
@ -658,7 +658,7 @@ describe('Test multiple servers', function () {
|
||||||
isLocal,
|
isLocal,
|
||||||
duration: 5,
|
duration: 5,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
tags: [ 'tag_up_1', 'tag_up_2' ],
|
tags: [ 'tag_up_1', 'tag_up_2' ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
channel: {
|
channel: {
|
||||||
|
@ -980,7 +980,7 @@ describe('Test multiple servers', function () {
|
||||||
isLocal,
|
isLocal,
|
||||||
duration: 5,
|
duration: 5,
|
||||||
commentsEnabled: false,
|
commentsEnabled: false,
|
||||||
downloadingEnabled: false,
|
downloadEnabled: false,
|
||||||
tags: [ ],
|
tags: [ ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
channel: {
|
channel: {
|
||||||
|
|
|
@ -55,7 +55,7 @@ describe('Test a single server', function () {
|
||||||
tags: [ 'tag1', 'tag2', 'tag3' ],
|
tags: [ 'tag1', 'tag2', 'tag3' ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
channel: {
|
channel: {
|
||||||
displayName: 'Main root channel',
|
displayName: 'Main root channel',
|
||||||
name: 'root_channel',
|
name: 'root_channel',
|
||||||
|
@ -88,7 +88,7 @@ describe('Test a single server', function () {
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
duration: 5,
|
duration: 5,
|
||||||
commentsEnabled: false,
|
commentsEnabled: false,
|
||||||
downloadingEnabled: false,
|
downloadEnabled: false,
|
||||||
channel: {
|
channel: {
|
||||||
name: 'root_channel',
|
name: 'root_channel',
|
||||||
displayName: 'Main root channel',
|
displayName: 'Main root channel',
|
||||||
|
@ -358,7 +358,7 @@ describe('Test a single server', function () {
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
description: 'my super description updated',
|
description: 'my super description updated',
|
||||||
commentsEnabled: false,
|
commentsEnabled: false,
|
||||||
downloadingEnabled: false,
|
downloadEnabled: false,
|
||||||
tags: [ 'tagup1', 'tagup2' ]
|
tags: [ 'tagup1', 'tagup2' ]
|
||||||
}
|
}
|
||||||
await updateVideo(server.url, server.accessToken, videoId, attributes)
|
await updateVideo(server.url, server.accessToken, videoId, attributes)
|
||||||
|
|
|
@ -27,7 +27,7 @@ type VideoAttributes = {
|
||||||
language?: string
|
language?: string
|
||||||
nsfw?: boolean
|
nsfw?: boolean
|
||||||
commentsEnabled?: boolean
|
commentsEnabled?: boolean
|
||||||
downloadingEnabled?: boolean
|
downloadEnabled?: boolean
|
||||||
waitTranscoding?: boolean
|
waitTranscoding?: boolean
|
||||||
description?: string
|
description?: string
|
||||||
tags?: string[]
|
tags?: string[]
|
||||||
|
@ -311,7 +311,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
|
||||||
tags: [ 'tag' ],
|
tags: [ 'tag' ],
|
||||||
privacy: VideoPrivacy.PUBLIC,
|
privacy: VideoPrivacy.PUBLIC,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
fixture: 'video_short.webm'
|
fixture: 'video_short.webm'
|
||||||
}, videoAttributesArg)
|
}, videoAttributesArg)
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
|
||||||
.field('name', attributes.name)
|
.field('name', attributes.name)
|
||||||
.field('nsfw', JSON.stringify(attributes.nsfw))
|
.field('nsfw', JSON.stringify(attributes.nsfw))
|
||||||
.field('commentsEnabled', JSON.stringify(attributes.commentsEnabled))
|
.field('commentsEnabled', JSON.stringify(attributes.commentsEnabled))
|
||||||
.field('downloadingEnabled', JSON.stringify(attributes.downloadingEnabled))
|
.field('downloadEnabled', JSON.stringify(attributes.downloadEnabled))
|
||||||
.field('waitTranscoding', JSON.stringify(attributes.waitTranscoding))
|
.field('waitTranscoding', JSON.stringify(attributes.waitTranscoding))
|
||||||
.field('privacy', attributes.privacy.toString())
|
.field('privacy', attributes.privacy.toString())
|
||||||
.field('channelId', attributes.channelId)
|
.field('channelId', attributes.channelId)
|
||||||
|
@ -373,7 +373,7 @@ function updateVideo (url: string, accessToken: string, id: number | string, att
|
||||||
if (attributes.language) body['language'] = attributes.language
|
if (attributes.language) body['language'] = attributes.language
|
||||||
if (attributes.nsfw !== undefined) body['nsfw'] = JSON.stringify(attributes.nsfw)
|
if (attributes.nsfw !== undefined) body['nsfw'] = JSON.stringify(attributes.nsfw)
|
||||||
if (attributes.commentsEnabled !== undefined) body['commentsEnabled'] = JSON.stringify(attributes.commentsEnabled)
|
if (attributes.commentsEnabled !== undefined) body['commentsEnabled'] = JSON.stringify(attributes.commentsEnabled)
|
||||||
if (attributes.downloadingEnabled !== undefined) body['downloadingEnabled'] = JSON.stringify(attributes.downloadingEnabled)
|
if (attributes.downloadEnabled !== undefined) body['downloadEnabled'] = JSON.stringify(attributes.downloadEnabled)
|
||||||
if (attributes.description) body['description'] = attributes.description
|
if (attributes.description) body['description'] = attributes.description
|
||||||
if (attributes.tags) body['tags'] = attributes.tags
|
if (attributes.tags) body['tags'] = attributes.tags
|
||||||
if (attributes.privacy) body['privacy'] = attributes.privacy
|
if (attributes.privacy) body['privacy'] = attributes.privacy
|
||||||
|
@ -439,7 +439,7 @@ async function completeVideoCheck (
|
||||||
language: string
|
language: string
|
||||||
nsfw: boolean
|
nsfw: boolean
|
||||||
commentsEnabled: boolean
|
commentsEnabled: boolean
|
||||||
downloadingEnabled: boolean
|
downloadEnabled: boolean
|
||||||
description: string
|
description: string
|
||||||
publishedAt?: string
|
publishedAt?: string
|
||||||
support: string
|
support: string
|
||||||
|
@ -514,7 +514,7 @@ async function completeVideoCheck (
|
||||||
expect(dateIsValid(videoDetails.channel.createdAt.toString())).to.be.true
|
expect(dateIsValid(videoDetails.channel.createdAt.toString())).to.be.true
|
||||||
expect(dateIsValid(videoDetails.channel.updatedAt.toString())).to.be.true
|
expect(dateIsValid(videoDetails.channel.updatedAt.toString())).to.be.true
|
||||||
expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled)
|
expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled)
|
||||||
expect(videoDetails.downloadingEnabled).to.equal(attributes.downloadingEnabled)
|
expect(videoDetails.downloadEnabled).to.equal(attributes.downloadEnabled)
|
||||||
|
|
||||||
for (const attributeFile of attributes.files) {
|
for (const attributeFile of attributes.files) {
|
||||||
const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution)
|
const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution)
|
||||||
|
|
|
@ -212,7 +212,7 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, cwd: st
|
||||||
nsfw: isNSFW(videoInfo),
|
nsfw: isNSFW(videoInfo),
|
||||||
waitTranscoding: true,
|
waitTranscoding: true,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
downloadingEnabled: true,
|
downloadEnabled: true,
|
||||||
description: videoInfo.description || undefined,
|
description: videoInfo.description || undefined,
|
||||||
support: undefined,
|
support: undefined,
|
||||||
tags,
|
tags,
|
||||||
|
|
|
@ -30,7 +30,7 @@ if (!program['tags']) program['tags'] = []
|
||||||
if (!program['nsfw']) program['nsfw'] = false
|
if (!program['nsfw']) program['nsfw'] = false
|
||||||
if (!program['privacy']) program['privacy'] = VideoPrivacy.PUBLIC
|
if (!program['privacy']) program['privacy'] = VideoPrivacy.PUBLIC
|
||||||
if (!program['commentsEnabled']) program['commentsEnabled'] = false
|
if (!program['commentsEnabled']) program['commentsEnabled'] = false
|
||||||
if (!program['downloadingEnabled']) program['downloadingEnabled'] = true
|
if (!program['downloadEnabled']) program['downloadEnabled'] = true
|
||||||
|
|
||||||
getSettings()
|
getSettings()
|
||||||
.then(settings => {
|
.then(settings => {
|
||||||
|
@ -117,7 +117,7 @@ async function run () {
|
||||||
description: program['videoDescription'],
|
description: program['videoDescription'],
|
||||||
tags: program['tags'],
|
tags: program['tags'],
|
||||||
commentsEnabled: program['commentsEnabled'],
|
commentsEnabled: program['commentsEnabled'],
|
||||||
downloadingEnabled: program['downloadingEnabled'],
|
downloadEnabled: program['downloadEnabled'],
|
||||||
fixture: program['file'],
|
fixture: program['file'],
|
||||||
thumbnailfile: program['thumbnail'],
|
thumbnailfile: program['thumbnail'],
|
||||||
previewfile: program['preview'],
|
previewfile: program['preview'],
|
||||||
|
|
|
@ -21,7 +21,7 @@ export interface VideoTorrentObject {
|
||||||
views: number
|
views: number
|
||||||
sensitive: boolean
|
sensitive: boolean
|
||||||
commentsEnabled: boolean,
|
commentsEnabled: boolean,
|
||||||
downloadingEnabled: boolean,
|
downloadEnabled: boolean,
|
||||||
waitTranscoding: boolean
|
waitTranscoding: boolean
|
||||||
state: VideoState
|
state: VideoState
|
||||||
published: string
|
published: string
|
||||||
|
|
|
@ -13,7 +13,7 @@ export interface VideoCreate {
|
||||||
name: string
|
name: string
|
||||||
tags?: string[]
|
tags?: string[]
|
||||||
commentsEnabled?: boolean
|
commentsEnabled?: boolean
|
||||||
downloadingEnabled?: boolean
|
downloadEnabled?: boolean
|
||||||
privacy: VideoPrivacy
|
privacy: VideoPrivacy
|
||||||
scheduleUpdate?: VideoScheduleUpdate
|
scheduleUpdate?: VideoScheduleUpdate
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ export interface VideoUpdate {
|
||||||
privacy?: VideoPrivacy
|
privacy?: VideoPrivacy
|
||||||
tags?: string[]
|
tags?: string[]
|
||||||
commentsEnabled?: boolean
|
commentsEnabled?: boolean
|
||||||
downloadingEnabled?: boolean
|
downloadEnabled?: boolean
|
||||||
nsfw?: boolean
|
nsfw?: boolean
|
||||||
waitTranscoding?: boolean
|
waitTranscoding?: boolean
|
||||||
channelId?: number
|
channelId?: number
|
||||||
|
|
|
@ -82,7 +82,7 @@ export interface VideoDetails extends Video {
|
||||||
files: VideoFile[]
|
files: VideoFile[]
|
||||||
account: Account
|
account: Account
|
||||||
commentsEnabled: boolean
|
commentsEnabled: boolean
|
||||||
downloadingEnabled: boolean
|
downloadEnabled: boolean
|
||||||
|
|
||||||
// Not optional in details (unlike in Video)
|
// Not optional in details (unlike in Video)
|
||||||
waitTranscoding: boolean
|
waitTranscoding: boolean
|
||||||
|
|
|
@ -536,7 +536,7 @@ paths:
|
||||||
- $ref: "videos.yaml#/parameters/name"
|
- $ref: "videos.yaml#/parameters/name"
|
||||||
- $ref: "videos.yaml#/parameters/tags"
|
- $ref: "videos.yaml#/parameters/tags"
|
||||||
- $ref: "videos.yaml#/parameters/commentsEnabled"
|
- $ref: "videos.yaml#/parameters/commentsEnabled"
|
||||||
- $ref: "videos.yaml#/parameters/downloadingEnabled"
|
- $ref: "videos.yaml#/parameters/downloadEnabled"
|
||||||
- $ref: "videos.yaml#/parameters/privacy"
|
- $ref: "videos.yaml#/parameters/privacy"
|
||||||
- $ref: "videos.yaml#/parameters/scheduleUpdate"
|
- $ref: "videos.yaml#/parameters/scheduleUpdate"
|
||||||
responses:
|
responses:
|
||||||
|
@ -633,7 +633,7 @@ paths:
|
||||||
- $ref: "videos.yaml#/parameters/name"
|
- $ref: "videos.yaml#/parameters/name"
|
||||||
- $ref: "videos.yaml#/parameters/tags"
|
- $ref: "videos.yaml#/parameters/tags"
|
||||||
- $ref: "videos.yaml#/parameters/commentsEnabled"
|
- $ref: "videos.yaml#/parameters/commentsEnabled"
|
||||||
- $ref: "videos.yaml#/parameters/downloadingEnabled"
|
- $ref: "videos.yaml#/parameters/downloadEnabled"
|
||||||
- $ref: "videos.yaml#/parameters/privacy"
|
- $ref: "videos.yaml#/parameters/privacy"
|
||||||
- $ref: "videos.yaml#/parameters/scheduleUpdate"
|
- $ref: "videos.yaml#/parameters/scheduleUpdate"
|
||||||
responses:
|
responses:
|
||||||
|
|
|
@ -65,8 +65,8 @@ parameters:
|
||||||
in: formData
|
in: formData
|
||||||
type: boolean
|
type: boolean
|
||||||
description: 'Enable or disable comments for this video'
|
description: 'Enable or disable comments for this video'
|
||||||
downloadingEnabled:
|
downloadEnabled:
|
||||||
name: downloadingEnabled
|
name: downloadEnabled
|
||||||
in: formData
|
in: formData
|
||||||
type: boolean
|
type: boolean
|
||||||
description: 'Enable or disable downloading for this video'
|
description: 'Enable or disable downloading for this video'
|
||||||
|
|
Loading…
Reference in New Issue