]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/abstract-video-list.ts
Merge branch 'release/v1.3.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / abstract-video-list.ts
index 467f629eae20e18983d2ccdd5e013e4a3a9bbc29..fa9d38735831cca4cd5ea7d795ef1143cc103be8 100644 (file)
@@ -7,7 +7,7 @@ import { ComponentPagination } from '../rest/component-pagination.model'
 import { VideoSortField } from './sort-field.type'
 import { Video } from './video.model'
 import { ScreenService } from '@app/shared/misc/screen.service'
-import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
+import { MiniatureDisplayOptions, OwnerDisplayType } from '@app/shared/video/video-miniature.component'
 import { Syndication } from '@app/shared/video/syndication.model'
 import { Notifier, ServerService } from '@app/core'
 import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
@@ -26,14 +26,24 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
   syndicationItems: Syndication[] = []
 
   loadOnInit = true
-  marginContent = true
   videos: Video[] = []
   ownerDisplayType: OwnerDisplayType = 'account'
   displayModerationBlock = false
   titleTooltip: string
+  displayVideoActions = true
 
   disabled = false
 
+  displayOptions: MiniatureDisplayOptions = {
+    date: true,
+    views: true,
+    by: true,
+    privacyLabel: true,
+    privacyText: false,
+    state: false,
+    blacklistInfo: false
+  }
+
   protected abstract notifier: Notifier
   protected abstract authService: AuthService
   protected abstract route: ActivatedRoute
@@ -102,6 +112,8 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
       ({ videos, totalVideos }) => {
         this.pagination.totalItems = totalVideos
         this.videos = this.videos.concat(videos)
+
+        this.onMoreVideos()
       },
 
       error => this.notifier.error(error.message)
@@ -118,6 +130,13 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
     throw new Error('toggleModerationDisplay is not implemented')
   }
 
+  removeVideoFromArray (video: Video) {
+    this.videos = this.videos.filter(v => v.id !== video.id)
+  }
+
+  // On videos hook for children that want to do something
+  protected onMoreVideos () { /* empty */ }
+
   protected loadRouteParams (routeParams: { [ key: string ]: any }) {
     this.sort = routeParams[ 'sort' ] as VideoSortField || this.defaultSort
     this.categoryOneOf = routeParams[ 'categoryOneOf' ]