1 import { Component, OnInit } from '@angular/core'
2 import { AuthService, AuthUser, ScreenService, ServerService } from '@app/core'
3 import { HTMLServerConfig } from '@shared/models'
4 import { TopMenuDropdownParam } from '../shared/shared-main/misc/top-menu-dropdown.component'
7 templateUrl: './my-library.component.html',
8 styleUrls: [ './my-library.component.scss' ]
10 export class MyLibraryComponent implements OnInit {
11 menuEntries: TopMenuDropdownParam[] = []
14 private serverConfig: HTMLServerConfig
17 private serverService: ServerService,
18 private authService: AuthService,
19 private screenService: ScreenService
22 get isBroadcastMessageDisplayed () {
23 return this.screenService.isBroadcastMessageDisplayed
27 this.serverConfig = this.serverService.getHTMLConfig()
29 this.user = this.authService.getUser()
31 this.authService.userInformationLoaded.subscribe(
32 () => this.buildMenu()
36 isVideoImportEnabled () {
37 const importConfig = this.serverConfig.import.videos
39 return importConfig.http.enabled || importConfig.torrent.enabled
42 private buildMenu () {
45 label: $localize`Channels`,
46 routerLink: '/my-library/video-channels'
50 if (this.user.canSeeVideosLink) {
51 this.menuEntries.push({
52 label: $localize`Videos`,
53 routerLink: '/my-library/videos'
57 this.menuEntries = this.menuEntries.concat([
59 label: $localize`Playlists`,
60 routerLink: '/my-library/video-playlists'
64 label: $localize`Follows`,
67 label: $localize`Subscriptions`,
68 iconName: 'subscriptions',
69 routerLink: '/my-library/subscriptions'
72 label: $localize`Followers`,
74 routerLink: '/my-library/followers'
80 label: $localize`History`,
81 routerLink: '/my-library/history/videos'