1 import { Component, OnDestroy, OnInit } from '@angular/core'
2 import { ActivatedRoute, Router } from '@angular/router'
3 import { Location } from '@angular/common'
4 import { immutableAssign } from '@app/shared/misc/utils'
5 import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
6 import { NotificationsService } from 'angular2-notifications'
7 import { AuthService } from '../../core/auth'
8 import { ConfirmService } from '../../core/confirm'
9 import { AbstractVideoList } from '../../shared/video/abstract-video-list'
10 import { VideoService } from '../../shared/video/video.service'
11 import { I18n } from '@ngx-translate/i18n-polyfill'
12 import { ScreenService } from '@app/shared/misc/screen.service'
13 import { UserHistoryService } from '@app/shared/users/user-history.service'
16 selector: 'my-account-history',
17 templateUrl: './my-account-history.component.html',
18 styleUrls: [ './my-account-history.component.scss' ]
20 export class MyAccountHistoryComponent extends AbstractVideoList implements OnInit, OnDestroy {
22 currentRoute = '/my-account/history/videos'
23 pagination: ComponentPagination = {
29 protected baseVideoWidth = -1
30 protected baseVideoHeight = 155
33 protected router: Router,
34 protected route: ActivatedRoute,
35 protected authService: AuthService,
36 protected notificationsService: NotificationsService,
37 protected location: Location,
38 protected screenService: ScreenService,
40 private confirmService: ConfirmService,
41 private videoService: VideoService,
42 private userHistoryService: UserHistoryService
46 this.titlePage = this.i18n('My videos history')
57 getVideosObservable (page: number) {
58 const newPagination = immutableAssign(this.pagination, { currentPage: page })
60 return this.userHistoryService.getUserVideosHistory(newPagination)
63 generateSyndicationList () {
64 throw new Error('Method not implemented.')