1 import { NgModule } from '@angular/core'
2 import { RouterModule, Routes, UrlSegment } from '@angular/router'
3 import { LoginGuard } from '@app/core'
4 import { VideosListCommonPageComponent } from './video-list'
5 import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
6 import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
7 import { VideosComponent } from './videos.component'
9 const videosRoutes: Routes = [
12 component: VideosComponent,
16 component: VideoOverviewComponent,
19 title: $localize`Discover videos`
25 // Old URL redirection
27 redirectTo: 'trending?sort=most-liked'
30 matcher: (url: UrlSegment[]) => {
31 if (url.length === 1 && [ 'recently-added', 'trending', 'local' ].includes(url[0].path)) {
35 page: new UrlSegment(url[0].path, {})
43 component: VideosListCommonPageComponent,
53 path: 'subscriptions',
54 canActivate: [ LoginGuard ],
55 component: VideoUserSubscriptionsComponent,
58 title: $localize`Subscriptions`
62 key: 'subscription-videos-list'
71 imports: [ RouterModule.forChild(videosRoutes) ],
72 exports: [ RouterModule ]
74 export class VideosRoutingModule {}