Fix live/upload redirection

This commit is contained in:
Chocobozzz 2021-08-18 11:39:45 +02:00
parent 586a7478b6
commit 2e80d256cc
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 16 additions and 7 deletions

View 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,

View 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

View 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 (

View 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)))
}