]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix live/upload redirection
authorChocobozzz <me@florianbigard.com>
Wed, 18 Aug 2021 09:39:45 +0000 (11:39 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 18 Aug 2021 09:39:45 +0000 (11:39 +0200)
client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
client/src/app/shared/shared-main/video/video-edit.model.ts
client/src/app/shared/shared-video-live/live-video.service.ts

index 1b9447e03343641effbfc2dc60aaafe1382d84e0..2065e4e8e75ff902bffcd521b9366528a01db9b6 100644 (file)
@@ -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,
index dee2bb57a9206f555b88d3f4fb8866f0d364f93a..56051cf4ca6a0319dbb6759d710be0c52e5134c3 100644 (file)
@@ -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
 
index ea04569421e883d52090ee569787c70a56be8bdc..436598af66dd15d18c41d4c9a1e2eb47c0f8aeb6 100644 (file)
@@ -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 (
index b02442eae2df984b1516e3ccf931ea88e64bded6..0d166e91d50565fb7325eb89c4ebf581f4d305df 100644 (file)
@@ -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)))
   }