]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
Refactor my-subscribe-button to support full account subscription
[github/Chocobozzz/PeerTube.git] / client / src / app / +accounts / account-video-channels / account-video-channels.component.ts
index 85dedd7defe03d49a778639d0028f44715acf29d..5572064c1c95c9e96cde71311cecd5c569c4b704 100644 (file)
@@ -11,6 +11,7 @@ import { AuthService } from '@app/core'
 import { VideoService } from '@app/shared/video/video.service'
 import { VideoSortField } from '@app/shared/video/sort-field.type'
 import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
+import { ScreenService } from '@app/shared/misc/screen.service'
 
 @Component({
   selector: 'my-account-video-channels',
@@ -24,12 +25,14 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
 
   channelPagination: ComponentPagination = {
     currentPage: 1,
-    itemsPerPage: 2
+    itemsPerPage: 2,
+    totalItems: null
   }
 
   videosPagination: ComponentPagination = {
     currentPage: 1,
-    itemsPerPage: 12
+    itemsPerPage: 12,
+    totalItems: null
   }
   videosSort: VideoSortField = '-publishedAt'
 
@@ -42,7 +45,8 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
     private authService: AuthService,
     private accountService: AccountService,
     private videoChannelService: VideoChannelService,
-    private videoService: VideoService
+    private videoService: VideoService,
+    private screenService: ScreenService
   ) { }
 
   get user () {
@@ -83,7 +87,10 @@ export class AccountVideoChannelsComponent implements OnInit, OnDestroy {
   }
 
   getVideosOf (videoChannel: VideoChannel) {
-    return this.videos[ videoChannel.id ]
+    const numberOfVideos = this.screenService.getNumberOfAvailableMiniatures()
+
+    // 2 rows
+    return this.videos[ videoChannel.id ].slice(0, numberOfVideos * 2)
   }
 
   onNearOfBottom () {