aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-02 18:15:41 +0200
committerChocobozzz <me@florianbigard.com>2021-06-02 18:15:41 +0200
commite030bfb59dd5ee65f20a64686ec9b22ca39f70ae (patch)
treec9a439159ef540291e3c030bcaf958b953442147 /client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
parent463206948d6a9d46e7e68d55c7b763e601ecc870 (diff)
downloadPeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.tar.gz
PeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.tar.zst
PeerTube-e030bfb59dd5ee65f20a64686ec9b22ca39f70ae.zip
Refactor server errors handler
Diffstat (limited to 'client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts')
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts6
1 files changed, 4 insertions, 2 deletions
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 23bd5ef76..2837b30c1 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
@@ -5,7 +5,7 @@ import { scrollToTop } from '@app/helpers'
5import { FormValidatorService } from '@app/shared/shared-forms' 5import { FormValidatorService } from '@app/shared/shared-forms'
6import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' 6import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main'
7import { LoadingBarService } from '@ngx-loading-bar/core' 7import { LoadingBarService } from '@ngx-loading-bar/core'
8import { ServerErrorCode, VideoPrivacy, VideoUpdate } from '@shared/models' 8import { PeerTubeProblemDocument, ServerErrorCode, VideoPrivacy, VideoUpdate } from '@shared/models'
9import { hydrateFormFromVideo } from '../shared/video-edit-utils' 9import { hydrateFormFromVideo } from '../shared/video-edit-utils'
10import { VideoSend } from './video-send' 10import { VideoSend } from './video-send'
11 11
@@ -115,7 +115,9 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af
115 this.firstStepError.emit() 115 this.firstStepError.emit()
116 116
117 let message = err.message 117 let message = err.message
118 if (err.body?.code === ServerErrorCode.INCORRECT_FILES_IN_TORRENT) { 118
119 const error = err.body as PeerTubeProblemDocument
120 if (error?.code === ServerErrorCode.INCORRECT_FILES_IN_TORRENT) {
119 message = $localize`Torrents with only 1 file are supported.` 121 message = $localize`Torrents with only 1 file are supported.`
120 } 122 }
121 123