]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/abstract-video-list.ts
NoImplicitAny flag true (#1157)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / abstract-video-list.ts
index 53b0444785859e96b97bb435c709eccdfac293f6..87814d4ba197d5a3832d3ee103a9a3713c3210ed 100644 (file)
@@ -27,7 +27,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
   sort: VideoSortField = '-publishedAt'
   categoryOneOf?: number
   defaultSort: VideoSortField = '-publishedAt'
-  syndicationItems = []
+  syndicationItems: any = []
 
   loadOnInit = true
   marginContent = true
@@ -37,6 +37,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
   videoPages: Video[][] = []
   ownerDisplayType: OwnerDisplayType = 'account'
   firstLoadedPage: number
+  displayModerationBlock = false
 
   protected baseVideoWidth = 215
   protected baseVideoHeight = 205
@@ -58,7 +59,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
   private resizeSubscription: Subscription
 
   abstract getVideosObservable (page: number): Observable<{ videos: Video[], totalVideos: number}>
-  abstract generateSyndicationList ()
+  abstract generateSyndicationList (): any
 
   get user () {
     return this.authService.getUser()
@@ -81,6 +82,15 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
     if (this.resizeSubscription) this.resizeSubscription.unsubscribe()
   }
 
+  pageByVideoId (index: number, page: Video[]) {
+    // Video are unique in all pages
+    return page.length !== 0 ? page[0].id : 0
+  }
+
+  videoById (index: number, video: Video) {
+    return video.id
+  }
+
   onNearOfTop () {
     this.previousPage()
   }
@@ -151,6 +161,10 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
     )
   }
 
+  toggleModerationDisplay () {
+    throw new Error('toggleModerationDisplay is not implemented')
+  }
+
   protected hasMoreVideos () {
     // No results
     if (this.pagination.totalItems === 0) return false
@@ -166,7 +180,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
     const min = this.minPageLoaded()
 
     if (min > 1) {
-      this.loadMoreVideos(min - 1)
+      this.loadMoreVideos(min - 1, true)
     }
   }
 
@@ -195,7 +209,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
   }
 
   protected setNewRouteParams () {
-    const paramsObject = this.buildRouteParams()
+    const paramsObject: any = this.buildRouteParams()
 
     const queryParams = Object.keys(paramsObject).map(p => p + '=' + paramsObject[p]).join('&')
     this.location.replaceState(this.currentRoute, queryParams)