1 import { NgModule } from '@angular/core'
2 import { RouterModule, Routes } from '@angular/router'
3 import { LoginGuard } from '@app/core'
4 import { VideoTrendingComponent } from './video-list'
5 import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
6 import { VideoLocalComponent } from './video-list/video-local.component'
7 import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
8 import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
9 import { VideosComponent } from './videos.component'
11 const videosRoutes: Routes = [
14 component: VideosComponent,
18 component: VideoOverviewComponent,
21 title: $localize`Discover videos`
27 component: VideoTrendingComponent,
30 title: $localize`Trending videos`
36 redirectTo: 'trending?alg=most-liked'
39 path: 'recently-added',
40 component: VideoRecentlyAddedComponent,
43 title: $localize`Recently added videos`
47 key: 'recently-added-videos-list'
52 path: 'subscriptions',
53 canActivate: [ LoginGuard ],
54 component: VideoUserSubscriptionsComponent,
57 title: $localize`Subscriptions`
61 key: 'subscription-videos-list'
67 component: VideoLocalComponent,
70 title: $localize`Local videos`
74 key: 'local-videos-list'
80 loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule),
83 title: $localize`Upload a video`
89 loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule),
92 title: $localize`Edit a video`
98 loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule),
108 imports: [ RouterModule.forChild(videosRoutes) ],
109 exports: [ RouterModule ]
111 export class VideosRoutingModule {}