X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-edit%2Fvideo-add-components%2Fvideo-import-torrent.component.ts;h=e9ad8af7a4be01ded86812ed302fd88772008950;hb=ce4e63c181973635a19029f7e792b5d202a22cfd;hp=538a187a83b61c47c1356e65b01ddf68b46072eb;hpb=1942f11d5ee6926ad93dc1b79fae18325ba5de18;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts index 538a187a8..e9ad8af7a 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts @@ -4,10 +4,9 @@ import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@a import { scrollToTop } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' -import { VideoSend } from './video-send' import { LoadingBarService } from '@ngx-loading-bar/core' -import { I18n } from '@ngx-translate/i18n-polyfill' import { VideoPrivacy, VideoUpdate } from '@shared/models' +import { VideoSend } from './video-send' @Component({ selector: 'my-video-import-torrent', @@ -43,9 +42,8 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca protected videoService: VideoService, protected videoCaptionService: VideoCaptionService, private router: Router, - private videoImportService: VideoImportService, - private i18n: I18n - ) { + private videoImportService: VideoImportService + ) { super() } @@ -84,11 +82,11 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca channelId: this.firstStepChannelId } - this.loadingBar.start() + this.loadingBar.useRef().start() this.videoImportService.importVideoTorrent(torrentfile || this.magnetUri, videoUpdate).subscribe( res => { - this.loadingBar.complete() + this.loadingBar.useRef().complete() this.firstStepDone.emit(res.video.name) this.isImportingVideo = false this.hasImportedVideo = true @@ -105,7 +103,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca }, err => { - this.loadingBar.complete() + this.loadingBar.useRef().complete() this.isImportingVideo = false this.firstStepError.emit() this.notifier.error(err.message) @@ -127,7 +125,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca .subscribe( () => { this.isUpdatingVideo = false - this.notifier.success(this.i18n('Video to import updated.')) + this.notifier.success($localize`Video to import updated.`) this.router.navigate([ '/my-account', 'video-imports' ]) },