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'
8 const videosRoutes: Routes = [
14 component: VideoOverviewComponent,
17 title: $localize`Discover videos`
23 // Old URL redirection
25 redirectTo: 'trending?sort=most-liked'
28 matcher: (url: UrlSegment[]) => {
29 if (url.length === 1 && [ 'recently-added', 'trending', 'local' ].includes(url[0].path)) {
33 page: new UrlSegment(url[0].path, {})
41 component: VideosListCommonPageComponent,
51 path: 'subscriptions',
52 canActivate: [ LoginGuard ],
53 component: VideoUserSubscriptionsComponent,
56 title: $localize`Subscriptions`
60 key: 'subscription-videos-list'
69 imports: [ RouterModule.forChild(videosRoutes) ],
70 exports: [ RouterModule ]
72 export class VideosRoutingModule {}