import { NotificationsService } from 'angular2-notifications'
import { VideoService } from 'app/shared/video/video.service'
import { VideoCreate } from '../../../../../shared'
import { NotificationsService } from 'angular2-notifications'
import { VideoService } from 'app/shared/video/video.service'
import { VideoCreate } from '../../../../../shared'
import { AuthService, ServerService } from '../../core'
import { FormReactive } from '../../shared'
import { ValidatorMessage } from '../../shared/forms/form-validators'
import { AuthService, ServerService } from '../../core'
import { FormReactive } from '../../shared'
import { ValidatorMessage } from '../../shared/forms/form-validators'
if (Array.isArray(videoChannels) === false) return
this.userVideoChannels = videoChannels.map(v => ({ id: v.id, label: v.name }))
if (Array.isArray(videoChannels) === false) return
this.userVideoChannels = videoChannels.map(v => ({ id: v.id, label: v.name }))
- const name = videofile.name
- const privacy = this.firstStepPrivacy.toString()
+ const name = videofile.name.replace(/\.[^/.]+$/, '')
+ const privacy = this.firstStepPrivacyId.toString()
const formData = new FormData()
formData.append('name', name)
const formData = new FormData()
formData.append('name', name)
formData.append('nsfw', '' + nsfw)
formData.append('channelId', '' + channelId)
formData.append('videofile', videofile)
formData.append('nsfw', '' + nsfw)
formData.append('channelId', '' + channelId)
formData.append('videofile', videofile)
this.videoService.uploadVideo(formData).subscribe(
event => {
if (event.type === HttpEventType.UploadProgress) {
this.videoService.uploadVideo(formData).subscribe(
event => {
if (event.type === HttpEventType.UploadProgress) {
} else if (event instanceof HttpResponse) {
console.log('Video uploaded.')
this.videoUploaded = true
} else if (event instanceof HttpResponse) {
console.log('Video uploaded.')
this.videoUploaded = true
- const video = new VideoEdit(this.form.value)
+ const video = new VideoEdit()
+ video.patch(this.form.value)
+ video.channel = this.firstStepChannelId
+ video.id = this.videoUploadedId
this.videoService.updateVideo(video)
.subscribe(
() => {
this.notificationsService.success('Success', 'Video published.')
this.videoService.updateVideo(video)
.subscribe(
() => {
this.notificationsService.success('Success', 'Video published.')