]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts
Reorganize player files
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-custom-markup / peertube-custom-tags / videos-list-markup.component.ts
index d9f77802b91e956ed55e9e38ad8d567336aef055..0e4d5fb12afc55b9ca3fb94ae148f4fe9354853a 100644 (file)
@@ -1,7 +1,7 @@
 import { finalize } from 'rxjs/operators'
 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
 import { AuthService, Notifier } from '@app/core'
-import { VideoFilter, VideoSortField } from '@shared/models'
+import { VideoSortField } from '@shared/models'
 import { Video, VideoService } from '../../shared-main'
 import { MiniatureDisplayOptions } from '../../shared-video-miniature'
 import { CustomMarkupComponent } from './shared'
@@ -21,7 +21,8 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit
   @Input() languageOneOf: string[]
   @Input() count: number
   @Input() onlyDisplayTitle: boolean
-  @Input() filter: VideoFilter
+  @Input() isLocal: boolean
+  @Input() isLive: boolean
   @Input() maxRows: number
   @Input() channelHandle: string
   @Input() accountHandle: string
@@ -70,11 +71,11 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit
 
     return this.getVideosObservable()
       .pipe(finalize(() => this.loaded.emit(true)))
-      .subscribe(
-        ({ data }) => this.videos = data,
+      .subscribe({
+        next: ({ data }) => this.videos = data,
 
-        err => this.notifier.error('Error in videos list component: ' + err.message)
-      )
+        error: err => this.notifier.error($localize`Error in videos list component: ${err.message}`)
+      })
   }
 
   getVideosObservable () {
@@ -85,7 +86,8 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit
       },
       categoryOneOf: this.categoryOneOf,
       languageOneOf: this.languageOneOf,
-      filter: this.filter,
+      isLocal: this.isLocal,
+      isLive: this.isLive,
       sort: this.sort as VideoSortField,
       account: { nameWithHost: this.accountHandle },
       videoChannel: { nameWithHost: this.channelHandle }