diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts index 1b9447e03..2065e4e8e 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts @@ -26,8 +26,11 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView isInUpdateForm = false liveVideo: LiveVideo + videoId: number videoUUID: string + videoShortUUID: string + error: string constructor ( @@ -79,6 +82,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView next: res => { this.videoId = res.video.id this.videoUUID = res.video.uuid + this.videoShortUUID = res.video.shortUUID this.isInUpdateForm = true this.firstStepDone.emit(name) @@ -113,6 +117,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView video.patch(this.form.value) video.id = this.videoId video.uuid = this.videoUUID + video.shortUUID = this.videoShortUUID const liveVideoUpdate: LiveVideoUpdate = { saveReplay: this.form.value.saveReplay, diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index dee2bb57a..56051cf4c 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts @@ -7,7 +7,7 @@ import { genericUploadErrorHandler, scrollToTop } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { BytesPipe, Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' import { LoadingBarService } from '@ngx-loading-bar/core' -import { HttpStatusCode, VideoPrivacy } from '@shared/models' +import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models' import { UploaderXFormData } from './uploaderx-form-data' import { VideoSend } from './video-send' @@ -33,9 +33,10 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy videoUploaded = false videoUploadPercents = 0 - videoUploadedIds = { + videoUploadedIds: VideoCreateResult = { id: 0, - uuid: '' + uuid: '', + shortUUID: '' } formData: FormData @@ -237,6 +238,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy video.patch(this.form.value) video.id = this.videoUploadedIds.id video.uuid = this.videoUploadedIds.uuid + video.shortUUID = this.videoUploadedIds.shortUUID this.isUpdatingVideo = true diff --git a/client/src/app/shared/shared-main/video/video-edit.model.ts b/client/src/app/shared/shared-main/video/video-edit.model.ts index ea0456942..436598af6 100644 --- a/client/src/app/shared/shared-main/video/video-edit.model.ts +++ b/client/src/app/shared/shared-main/video/video-edit.model.ts @@ -20,11 +20,13 @@ export class VideoEdit implements VideoUpdate { previewfile?: any thumbnailUrl: string previewUrl: string - uuid?: string - id?: number scheduleUpdate?: VideoScheduleUpdate originallyPublishedAt?: Date | string + id?: number + uuid?: string + shortUUID?: string + pluginData?: any constructor ( diff --git a/client/src/app/shared/shared-video-live/live-video.service.ts b/client/src/app/shared/shared-video-live/live-video.service.ts index b02442eae..0d166e91d 100644 --- a/client/src/app/shared/shared-video-live/live-video.service.ts +++ b/client/src/app/shared/shared-video-live/live-video.service.ts @@ -2,7 +2,7 @@ import { catchError } from 'rxjs/operators' import { HttpClient } from '@angular/common/http' import { Injectable } from '@angular/core' import { RestExtractor } from '@app/core' -import { LiveVideo, LiveVideoCreate, LiveVideoUpdate } from '@shared/models' +import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, VideoCreateResult } from '@shared/models' import { environment } from '../../../environments/environment' @Injectable() @@ -16,7 +16,7 @@ export class LiveVideoService { goLive (video: LiveVideoCreate) { return this.authHttp - .post<{ video: { id: number, uuid: string } }>(LiveVideoService.BASE_VIDEO_LIVE_URL, video) + .post<{ video: VideoCreateResult }>(LiveVideoService.BASE_VIDEO_LIVE_URL, video) .pipe(catchError(err => this.restExtractor.handleError(err))) }