super.ngOnInit()
this.userService.getMyVideoQuotaUsed()
- .subscribe(data => this.userVideoQuotaUsed = data.videoQuotaUsed)
-
- this.userService.getMyVideoQuotaUsed()
- .subscribe(data => this.userVideoQuotaUsedDaily = data.videoQuotaUsedDaily)
+ .subscribe(data => {
+ this.userVideoQuotaUsed = data.videoQuotaUsed
+ this.userVideoQuotaUsedDaily = data.videoQuotaUsedDaily
+ })
}
ngOnDestroy () {
if (this.videoUploaded === true) {
// FIXME: cannot concatenate strings inside i18n service :/
- text = this.i18n('Your video was uploaded to your account and is private.') +
+ text = this.i18n('Your video was uploaded to your account and is private.') + ' ' +
this.i18n('But associated data (tags, description...) will be lost, are you sure you want to leave this page?')
} else {
text = this.i18n('Your video is not uploaded yet, are you sure you want to leave this page?')
const videoQuota = this.authService.getUser().videoQuota
if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) {
const msg = this.i18n(
- 'Your video quota is exceeded with this video (video size: {{ videoSize }}, used: {{ videoQuotaUsed }}, quota: {{ videoQuota }})',
+ 'Your video quota is exceeded with this video (video size: {{videoSize}}, used: {{videoQuotaUsed}}, quota: {{videoQuota}})',
{
videoSize: bytePipes.transform(videofile.size, 0),
videoQuotaUsed: bytePipes.transform(this.userVideoQuotaUsed, 0),
const videoQuotaDaily = this.authService.getUser().videoQuotaDaily
if (videoQuotaDaily !== -1 && (this.userVideoQuotaUsedDaily + videofile.size) > videoQuotaDaily) {
const msg = this.i18n(
- 'Your daily video quota is exceeded with this video (video size: {{ videoSize }}, ' +
- 'used: {{ videoQuotaUsedDaily }}, quota: {{ videoQuotaDaily }})',
+ 'Your daily video quota is exceeded with this video (video size: {{videoSize}}, used: {{quotaUsedDaily}}, quota: {{quotaDaily}})',
{
videoSize: bytePipes.transform(videofile.size, 0),
- videoQuotaUsedDaily: bytePipes.transform(this.userVideoQuotaUsedDaily, 0),
- videoQuotaDaily: bytePipes.transform(videoQuotaDaily, 0)
+ quotaUsedDaily: bytePipes.transform(this.userVideoQuotaUsedDaily, 0),
+ quotaDaily: bytePipes.transform(videoQuotaDaily, 0)
}
)
this.notificationsService.error(this.i18n('Error'), msg)
const nsfw = false
const waitTranscoding = true
const commentsEnabled = true
+ const downloadingEnabled = true
const channelId = this.firstStepChannelId.toString()
const formData = new FormData()
formData.append('privacy', VideoPrivacy.PRIVATE.toString())
formData.append('nsfw', '' + nsfw)
formData.append('commentsEnabled', '' + commentsEnabled)
+ formData.append('downloadingEnabled', '' + downloadingEnabled)
formData.append('waitTranscoding', '' + waitTranscoding)
formData.append('channelId', '' + channelId)
formData.append('videofile', videofile)
channelId
})
+ this.videoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies)
+
this.videoUploadObservable = this.videoService.uploadVideo(formData).subscribe(
event => {
if (event.type === HttpEventType.UploadProgress) {
)
}
+ isPublishingButtonDisabled () {
+ return !this.form.valid ||
+ this.isUpdatingVideo === true ||
+ this.videoUploaded !== true
+ }
+
updateSecondStep () {
if (this.checkForm() === false) {
return