diff options
Diffstat (limited to 'client/src/app/+videos/+video-edit')
4 files changed, 40 insertions, 11 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts index 34119f7ab..3d916dbce 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts | |||
@@ -21,8 +21,15 @@ import { | |||
21 | import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms' | 21 | import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms' |
22 | import { InstanceService } from '@app/shared/shared-instance' | 22 | import { InstanceService } from '@app/shared/shared-instance' |
23 | import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' | 23 | import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' |
24 | import { LiveVideo, ServerConfig, VideoConstant, VideoDetails, VideoPrivacy } from '@shared/models' | 24 | import { |
25 | import { RegisterClientFormFieldOptions, RegisterClientVideoFieldOptions } from '@shared/models/plugins/register-client-form-field.model' | 25 | LiveVideo, |
26 | RegisterClientFormFieldOptions, | ||
27 | RegisterClientVideoFieldOptions, | ||
28 | ServerConfig, | ||
29 | VideoConstant, | ||
30 | VideoDetails, | ||
31 | VideoPrivacy | ||
32 | } from '@shared/models' | ||
26 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' | 33 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' |
27 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' | 34 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' |
28 | import { VideoEditType } from './video-edit.type' | 35 | import { VideoEditType } from './video-edit.type' |
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 3aae24732..23bd5ef76 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' | |||
5 | import { FormValidatorService } from '@app/shared/shared-forms' | 5 | import { FormValidatorService } from '@app/shared/shared-forms' |
6 | import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' | 6 | import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' |
7 | import { LoadingBarService } from '@ngx-loading-bar/core' | 7 | import { LoadingBarService } from '@ngx-loading-bar/core' |
8 | import { VideoPrivacy, VideoUpdate } from '@shared/models' | 8 | import { ServerErrorCode, VideoPrivacy, VideoUpdate } from '@shared/models' |
9 | import { hydrateFormFromVideo } from '../shared/video-edit-utils' | 9 | import { hydrateFormFromVideo } from '../shared/video-edit-utils' |
10 | import { VideoSend } from './video-send' | 10 | import { VideoSend } from './video-send' |
11 | 11 | ||
@@ -113,7 +113,13 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af | |||
113 | this.loadingBar.useRef().complete() | 113 | this.loadingBar.useRef().complete() |
114 | this.isImportingVideo = false | 114 | this.isImportingVideo = false |
115 | this.firstStepError.emit() | 115 | this.firstStepError.emit() |
116 | this.notifier.error(err.message) | 116 | |
117 | let message = err.message | ||
118 | if (err.body?.code === ServerErrorCode.INCORRECT_FILES_IN_TORRENT) { | ||
119 | message = $localize`Torrents with only 1 file are supported.` | ||
120 | } | ||
121 | |||
122 | this.notifier.error(message) | ||
117 | } | 123 | } |
118 | ) | 124 | ) |
119 | } | 125 | } |
diff --git a/client/src/app/+videos/+video-edit/video-add.component.html b/client/src/app/+videos/+video-edit/video-add.component.html index dc8c2f21d..ac75d9ff8 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.html +++ b/client/src/app/+videos/+video-edit/video-add.component.html | |||
@@ -20,8 +20,8 @@ | |||
20 | <ng-container *ngIf="secondStepType === 'upload'" i18n>Upload {{ videoName }}</ng-container> | 20 | <ng-container *ngIf="secondStepType === 'upload'" i18n>Upload {{ videoName }}</ng-container> |
21 | </div> | 21 | </div> |
22 | 22 | ||
23 | <div ngbNav #nav="ngbNav" class="nav-tabs video-add-nav" [ngClass]="{ 'hide-nav': secondStepType !== undefined }"> | 23 | <div ngbNav #nav="ngbNav" class="nav-tabs video-add-nav" [activeId]="activeNav" (activeIdChange)="onNavChange($event)" [ngClass]="{ 'hide-nav': !!secondStepType }"> |
24 | <ng-container ngbNavItem> | 24 | <ng-container ngbNavItem="upload"> |
25 | <a ngbNavLink> | 25 | <a ngbNavLink> |
26 | <span i18n>Upload a file</span> | 26 | <span i18n>Upload a file</span> |
27 | </a> | 27 | </a> |
@@ -31,7 +31,7 @@ | |||
31 | </ng-template> | 31 | </ng-template> |
32 | </ng-container> | 32 | </ng-container> |
33 | 33 | ||
34 | <ng-container ngbNavItem *ngIf="isVideoImportHttpEnabled()"> | 34 | <ng-container ngbNavItem="import-url" *ngIf="isVideoImportHttpEnabled()"> |
35 | <a ngbNavLink> | 35 | <a ngbNavLink> |
36 | <span i18n>Import with URL</span> | 36 | <span i18n>Import with URL</span> |
37 | </a> | 37 | </a> |
@@ -41,7 +41,7 @@ | |||
41 | </ng-template> | 41 | </ng-template> |
42 | </ng-container> | 42 | </ng-container> |
43 | 43 | ||
44 | <ng-container ngbNavItem *ngIf="isVideoImportTorrentEnabled()"> | 44 | <ng-container ngbNavItem="import-torrent" *ngIf="isVideoImportTorrentEnabled()"> |
45 | <a ngbNavLink> | 45 | <a ngbNavLink> |
46 | <span i18n>Import with torrent</span> | 46 | <span i18n>Import with torrent</span> |
47 | </a> | 47 | </a> |
@@ -51,7 +51,7 @@ | |||
51 | </ng-template> | 51 | </ng-template> |
52 | </ng-container> | 52 | </ng-container> |
53 | 53 | ||
54 | <ng-container ngbNavItem *ngIf="isVideoLiveEnabled()"> | 54 | <ng-container ngbNavItem="go-live" *ngIf="isVideoLiveEnabled()"> |
55 | <a ngbNavLink> | 55 | <a ngbNavLink> |
56 | <span i18n>Go live</span> | 56 | <span i18n>Go live</span> |
57 | </a> | 57 | </a> |
diff --git a/client/src/app/+videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts index 441d5a3db..d735c936c 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.ts +++ b/client/src/app/+videos/+video-edit/video-add.component.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { Component, HostListener, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, HostListener, OnInit, ViewChild } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | ||
2 | import { AuthService, AuthUser, CanComponentDeactivate, ServerService } from '@app/core' | 3 | import { AuthService, AuthUser, CanComponentDeactivate, ServerService } from '@app/core' |
3 | import { ServerConfig } from '@shared/models' | 4 | import { ServerConfig } from '@shared/models' |
4 | import { VideoEditType } from './shared/video-edit.type' | 5 | import { VideoEditType } from './shared/video-edit.type' |
@@ -22,11 +23,16 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { | |||
22 | 23 | ||
23 | secondStepType: VideoEditType | 24 | secondStepType: VideoEditType |
24 | videoName: string | 25 | videoName: string |
25 | serverConfig: ServerConfig | 26 | |
27 | activeNav: string | ||
28 | |||
29 | private serverConfig: ServerConfig | ||
26 | 30 | ||
27 | constructor ( | 31 | constructor ( |
28 | private auth: AuthService, | 32 | private auth: AuthService, |
29 | private serverService: ServerService | 33 | private serverService: ServerService, |
34 | private route: ActivatedRoute, | ||
35 | private router: Router | ||
30 | ) {} | 36 | ) {} |
31 | 37 | ||
32 | get userInformationLoaded () { | 38 | get userInformationLoaded () { |
@@ -42,6 +48,16 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { | |||
42 | .subscribe(config => this.serverConfig = config) | 48 | .subscribe(config => this.serverConfig = config) |
43 | 49 | ||
44 | this.user = this.auth.getUser() | 50 | this.user = this.auth.getUser() |
51 | |||
52 | if (this.route.snapshot.fragment) { | ||
53 | this.onNavChange(this.route.snapshot.fragment) | ||
54 | } | ||
55 | } | ||
56 | |||
57 | onNavChange (newActiveNav: string) { | ||
58 | this.activeNav = newActiveNav | ||
59 | |||
60 | this.router.navigate([], { fragment: this.activeNav }) | ||
45 | } | 61 | } |
46 | 62 | ||
47 | onFirstStepDone (type: VideoEditType, videoName: string) { | 63 | onFirstStepDone (type: VideoEditType, videoName: string) { |