1 import { NgModule } from '@angular/core'
2 import { RouterModule, Routes } from '@angular/router'
3 import { LoginGuard, TrendingGuard } from '@app/core'
4 import { MetaGuard } from '@ngx-meta/core'
5 import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
6 import { VideoHotComponent } from './video-list/trending/video-hot.component'
7 import { VideoMostLikedComponent } from './video-list/trending/video-most-liked.component'
8 import { VideoMostViewedComponent } from './video-list/trending/video-most-viewed.component'
9 import { VideoLocalComponent } from './video-list/video-local.component'
10 import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
11 import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
12 import { VideosComponent } from './videos.component'
14 const videosRoutes: Routes = [
17 component: VideosComponent,
18 canActivateChild: [ MetaGuard ],
22 component: VideoOverviewComponent,
25 title: $localize`Discover videos`
31 canActivate: [ TrendingGuard ]
35 component: VideoHotComponent,
38 title: $localize`Hot videos`
42 key: 'hot-videos-list'
48 component: VideoMostViewedComponent,
51 title: $localize`Most viewed videos`
55 key: 'most-viewed-videos-list'
61 component: VideoMostLikedComponent,
64 title: $localize`Most liked videos`
68 key: 'most-liked-videos-list'
73 path: 'recently-added',
74 component: VideoRecentlyAddedComponent,
77 title: $localize`Recently added videos`
81 key: 'recently-added-videos-list'
86 path: 'subscriptions',
87 canActivate: [ LoginGuard ],
88 component: VideoUserSubscriptionsComponent,
91 title: $localize`Subscriptions`
95 key: 'subscription-videos-list'
101 component: VideoLocalComponent,
104 title: $localize`Local videos`
108 key: 'local-videos-list'
114 loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule),
117 title: $localize`Upload a video`
122 path: 'update/:uuid',
123 loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule),
126 title: $localize`Edit a video`
132 loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule),
142 imports: [ RouterModule.forChild(videosRoutes) ],
143 exports: [ RouterModule ]
145 export class VideosRoutingModule {}