From a1eda903a497857017495f37a1fd3593ba7ab23c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 May 2021 11:36:33 +0200 Subject: Support '/w/' and '/w/p/' for watch page And use them as default in client --- .../video-go-live.component.ts | 2 +- .../video-add-components/video-upload.component.ts | 2 +- .../+video-edit/video-update.component.html | 2 +- .../+videos/+video-edit/video-update.component.ts | 2 +- .../comment/video-comment.component.html | 4 ++-- .../+video-watch/video-watch-routing.module.ts | 2 +- .../+videos/+video-watch/video-watch.component.ts | 2 +- client/src/app/+videos/videos-routing.module.ts | 25 ---------------------- 8 files changed, 8 insertions(+), 33 deletions(-) (limited to 'client/src/app/+videos') diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts index 8e035b6bb..727bbc32f 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts @@ -127,7 +127,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView () => { this.notifier.success($localize`Live published.`) - this.router.navigate(['/videos/watch', video.uuid]) + this.router.navigate(['/w', video.uuid]) }, err => { diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index bca1b6eb6..e20f08879 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts @@ -244,7 +244,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy this.isUploadingVideo = false this.notifier.success($localize`Video published.`) - this.router.navigate([ '/videos/watch', video.uuid ]) + this.router.navigate([ '/w', video.uuid ]) }, err => { diff --git a/client/src/app/+videos/+video-edit/video-update.component.html b/client/src/app/+videos/+video-edit/video-update.component.html index 3ce3e623e..9629081e3 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.html +++ b/client/src/app/+videos/+video-edit/video-update.component.html @@ -1,7 +1,7 @@
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts index 2973c6840..574669a23 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts @@ -156,7 +156,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { this.isUpdatingVideo = false this.loadingBar.useRef().complete() this.notifier.success($localize`Video updated.`) - this.router.navigate([ '/videos/watch', this.video.uuid ]) + this.router.navigate([ '/w', this.video.uuid ]) }, err => { diff --git a/client/src/app/+videos/+video-watch/comment/video-comment.component.html b/client/src/app/+videos/+video-watch/comment/video-comment.component.html index fc0d66ffd..06548edc8 100644 --- a/client/src/app/+videos/+video-watch/comment/video-comment.component.html +++ b/client/src/app/+videos/+video-watch/comment/video-comment.component.html @@ -20,7 +20,7 @@
- + {{ comment.createdAt | myFromNow }} @@ -45,7 +45,7 @@ diff --git a/client/src/app/+videos/+video-watch/video-watch-routing.module.ts b/client/src/app/+videos/+video-watch/video-watch-routing.module.ts index cb77685c0..657fd10f8 100644 --- a/client/src/app/+videos/+video-watch/video-watch-routing.module.ts +++ b/client/src/app/+videos/+video-watch/video-watch-routing.module.ts @@ -4,7 +4,7 @@ import { VideoWatchComponent } from './video-watch.component' const videoWatchRoutes: Routes = [ { - path: 'playlist/:playlistId', + path: 'p/:playlistId', component: VideoWatchComponent }, { diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index 88c5cef52..0acd44524 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -690,7 +690,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { if (this.playlist) { this.zone.run(() => this.videoWatchPlaylist.navigateToNextPlaylistVideo()) } else if (this.nextVideoUuid) { - this.router.navigate([ '/videos/watch', this.nextVideoUuid ]) + this.router.navigate([ '/w', this.nextVideoUuid ]) } } diff --git a/client/src/app/+videos/videos-routing.module.ts b/client/src/app/+videos/videos-routing.module.ts index f9f476b18..926dfaab0 100644 --- a/client/src/app/+videos/videos-routing.module.ts +++ b/client/src/app/+videos/videos-routing.module.ts @@ -74,31 +74,6 @@ const videosRoutes: Routes = [ key: 'local-videos-list' } } - }, - { - path: 'upload', - loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule), - data: { - meta: { - title: $localize`Upload a video` - } - } - }, - { - path: 'update/:uuid', - loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule), - data: { - meta: { - title: $localize`Edit a video` - } - } - }, - { - path: 'watch', - loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule), - data: { - preload: 3000 - } } ] } -- cgit v1.2.3