1 import { NgModule } from '@angular/core'
2 import { RouterModule, Routes } from '@angular/router'
3 import { LoginGuard } from '@app/core'
4 import { MetaGuard } from '@ngx-meta/core'
5 import { VideoTrendingComponent } from './video-list'
6 import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
7 import { VideoLocalComponent } from './video-list/video-local.component'
8 import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
9 import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
10 import { VideosComponent } from './videos.component'
12 const videosRoutes: Routes = [
15 component: VideosComponent,
16 canActivateChild: [ MetaGuard ],
20 component: VideoOverviewComponent,
23 title: $localize`Discover videos`
29 component: VideoTrendingComponent,
32 title: $localize`Trending videos`
38 redirectTo: 'trending?alg=most-liked'
41 path: 'recently-added',
42 component: VideoRecentlyAddedComponent,
45 title: $localize`Recently added videos`
49 key: 'recently-added-videos-list'
54 path: 'subscriptions',
55 canActivate: [ LoginGuard ],
56 component: VideoUserSubscriptionsComponent,
59 title: $localize`Subscriptions`
63 key: 'subscription-videos-list'
69 component: VideoLocalComponent,
72 title: $localize`Local videos`
76 key: 'local-videos-list'
82 loadChildren: () => import('@app/+videos/+video-edit/video-add.module').then(m => m.VideoAddModule),
85 title: $localize`Upload a video`
91 loadChildren: () => import('@app/+videos/+video-edit/video-update.module').then(m => m.VideoUpdateModule),
94 title: $localize`Edit a video`
100 loadChildren: () => import('@app/+videos/+video-watch/video-watch.module').then(m => m.VideoWatchModule),
110 imports: [ RouterModule.forChild(videosRoutes) ],
111 exports: [ RouterModule ]
113 export class VideosRoutingModule {}