X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-edit%2Fvideo-add-components%2Fvideo-import-url.component.ts;h=7a9fe369f108e96e41adf35256a23477a9f83c50;hb=a786d8a08bf99f339bf16808f46e160404497ae2;hp=47f59a5d012ca6392eba319d7d50763871f62fc9;hpb=c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts index 47f59a5d0..7a9fe369f 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts @@ -1,7 +1,7 @@ import { map, switchMap } from 'rxjs/operators' -import { Component, EventEmitter, OnInit, Output } from '@angular/core' +import { AfterViewInit, Component, EventEmitter, OnInit, Output } from '@angular/core' import { Router } from '@angular/router' -import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core' +import { AuthService, CanComponentDeactivate, HooksService, Notifier, ServerService } from '@app/core' import { getAbsoluteAPIUrl, scrollToTop } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' @@ -18,7 +18,7 @@ import { VideoSend } from './video-send' './video-send.scss' ] }) -export class VideoImportUrlComponent extends VideoSend implements OnInit, CanComponentDeactivate { +export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterViewInit, CanComponentDeactivate { @Output() firstStepDone = new EventEmitter() @Output() firstStepError = new EventEmitter() @@ -42,8 +42,9 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom protected videoService: VideoService, protected videoCaptionService: VideoCaptionService, private router: Router, - private videoImportService: VideoImportService - ) { + private videoImportService: VideoImportService, + private hooks: HooksService + ) { super() } @@ -51,6 +52,10 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom super.ngOnInit() } + ngAfterViewInit () { + this.hooks.runAction('action:video-url-import.init', 'video-edit') + } + canDeactivate () { return { canDeactivate: true } } @@ -63,7 +68,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom this.isImportingVideo = true const videoUpdate: VideoUpdate = { - privacy: this.firstStepPrivacyId, + privacy: VideoPrivacy.PRIVATE, waitTranscoding: false, commentsEnabled: true, downloadEnabled: true, @@ -103,6 +108,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom this.video = new VideoEdit(Object.assign(video, { commentsEnabled: videoUpdate.commentsEnabled, downloadEnabled: videoUpdate.downloadEnabled, + privacy: { id: this.firstStepPrivacyId }, support: null, thumbnailUrl, previewUrl @@ -138,7 +144,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom this.isUpdatingVideo = false this.notifier.success($localize`Video to import updated.`) - this.router.navigate([ '/my-account', 'video-imports' ]) + this.router.navigate([ '/my-library', 'video-imports' ]) }, err => {