]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+videos/videos-routing.module.ts
Cleanup
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / videos-routing.module.ts
CommitLineData
df98563e 1import { NgModule } from '@angular/core'
57c36b27 2import { RouterModule, Routes } from '@angular/router'
ba5d4a84 3import { LoginGuard } from '@app/core'
ba5d4a84 4import { VideoTrendingComponent } from './video-list'
1942f11d
C
5import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
6import { VideoLocalComponent } from './video-list/video-local.component'
9bf9d2a5 7import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
67ed6552 8import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
1942f11d 9import { VideosComponent } from './videos.component'
0629423c 10
693b1aba 11const videosRoutes: Routes = [
0629423c 12 {
1942f11d 13 path: '',
0629423c
C
14 component: VideosComponent,
15 children: [
2d3741d6
C
16 {
17 path: 'overview',
18 component: VideoOverviewComponent,
19 data: {
20 meta: {
f29f487e 21 title: $localize`Discover videos`
2d3741d6
C
22 }
23 }
24 },
0629423c 25 {
9bf9d2a5 26 path: 'trending',
ba5d4a84 27 component: VideoTrendingComponent,
9bf9d2a5
C
28 data: {
29 meta: {
ba5d4a84 30 title: $localize`Trending videos`
5bcbcbe3
RK
31 }
32 }
33 },
c07eb946
JM
34 {
35 path: 'most-liked',
ba5d4a84 36 redirectTo: 'trending?alg=most-liked'
c07eb946 37 },
9bf9d2a5
C
38 {
39 path: 'recently-added',
40 component: VideoRecentlyAddedComponent,
b58c69a1
C
41 data: {
42 meta: {
f29f487e 43 title: $localize`Recently added videos`
489290b8
C
44 },
45 reuse: {
46 enabled: true,
47 key: 'recently-added-videos-list'
b58c69a1
C
48 }
49 }
0629423c 50 },
066e94c5 51 {
22a16e36 52 path: 'subscriptions',
b2dd58a8 53 canActivate: [ LoginGuard ],
22a16e36
C
54 component: VideoUserSubscriptionsComponent,
55 data: {
56 meta: {
f29f487e 57 title: $localize`Subscriptions`
489290b8
C
58 },
59 reuse: {
60 enabled: true,
61 key: 'subscription-videos-list'
22a16e36
C
62 }
63 }
64 },
65 {
066e94c5
C
66 path: 'local',
67 component: VideoLocalComponent,
68 data: {
69 meta: {
f29f487e 70 title: $localize`Local videos`
489290b8
C
71 },
72 reuse: {
73 enabled: true,
74 key: 'local-videos-list'
066e94c5
C
75 }
76 }
77 },
0629423c 78 {
f47bf2e1 79 path: 'upload',
1942f11d 80 loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule),
b58c69a1
C
81 data: {
82 meta: {
f29f487e 83 title: $localize`Upload a video`
b58c69a1
C
84 }
85 }
0629423c 86 },
d8e689b8 87 {
c663955b 88 path: 'update/:uuid',
1942f11d 89 loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule),
d8e689b8
C
90 data: {
91 meta: {
f29f487e 92 title: $localize`Edit a video`
d8e689b8
C
93 }
94 }
95 },
91219e66 96 {
f0a39880 97 path: 'watch',
1942f11d 98 loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule),
a685e25c
C
99 data: {
100 preload: 3000
101 }
0629423c
C
102 }
103 ]
104 }
df98563e 105]
693b1aba
C
106
107@NgModule({
108 imports: [ RouterModule.forChild(videosRoutes) ],
109 exports: [ RouterModule ]
110})
111export class VideosRoutingModule {}