1 import { Component } from '@angular/core'
2 import { ServerService } from '@app/core'
3 import { I18n } from '@ngx-translate/i18n-polyfill'
4 import { TopMenuDropdownParam } from '@app/shared/menu/top-menu-dropdown.component'
7 selector: 'my-my-account',
8 templateUrl: './my-account.component.html',
9 styleUrls: [ './my-account.component.scss' ]
11 export class MyAccountComponent {
12 menuEntries: TopMenuDropdownParam[] = []
15 private serverService: ServerService,
19 const libraryEntries: TopMenuDropdownParam = {
20 label: this.i18n('My library'),
23 label: this.i18n('My channels'),
24 routerLink: '/my-account/videos'
27 label: this.i18n('My videos'),
28 routerLink: '/my-account/videos'
31 label: this.i18n('My subscriptions'),
32 routerLink: '/my-account/subscriptions'
37 if (this.isVideoImportEnabled()) {
38 libraryEntries.children.push({
40 routerLink: '/my-account/video-imports'
44 const miscEntries: TopMenuDropdownParam = {
45 label: this.i18n('Misc'),
48 label: this.i18n('Muted accounts'),
49 routerLink: '/my-account/blocklist/accounts'
52 label: this.i18n('Muted instances'),
53 routerLink: '/my-account/blocklist/servers'
56 label: this.i18n('Ownership changes'),
57 routerLink: '/my-account/ownership'
64 label: this.i18n('My settings'),
65 routerLink: '/my-account/settings'
72 isVideoImportEnabled () {
73 const importConfig = this.serverService.getConfig().import.videos
75 return importConfig.http.enabled || importConfig.torrent.enabled