aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/abstract-video-list.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/video/abstract-video-list.ts')
-rw-r--r--client/src/app/shared/video/abstract-video-list.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.ts
index cf4b5ef8e..8a247a9af 100644
--- a/client/src/app/shared/video/abstract-video-list.ts
+++ b/client/src/app/shared/video/abstract-video-list.ts
@@ -13,6 +13,7 @@ import { Notifier, ServerService } from '@app/core'
13import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' 13import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
14import { I18n } from '@ngx-translate/i18n-polyfill' 14import { I18n } from '@ngx-translate/i18n-polyfill'
15import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date' 15import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date'
16import { ResultList } from '@shared/models'
16 17
17enum GroupDate { 18enum GroupDate {
18 UNKNOWN = 0, 19 UNKNOWN = 0,
@@ -73,7 +74,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
73 private groupedDateLabels: { [id in GroupDate]: string } 74 private groupedDateLabels: { [id in GroupDate]: string }
74 private groupedDates: { [id: number]: GroupDate } = {} 75 private groupedDates: { [id: number]: GroupDate } = {}
75 76
76 abstract getVideosObservable (page: number): Observable<{ videos: Video[], totalVideos: number }> 77 abstract getVideosObservable (page: number): Observable<ResultList<Video>>
77 78
78 abstract generateSyndicationList (): void 79 abstract generateSyndicationList (): void
79 80
@@ -138,12 +139,10 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy, DisableFor
138 } 139 }
139 140
140 loadMoreVideos () { 141 loadMoreVideos () {
141 const observable = this.getVideosObservable(this.pagination.currentPage) 142 this.getVideosObservable(this.pagination.currentPage).subscribe(
142 143 ({ data, total }) => {
143 observable.subscribe( 144 this.pagination.totalItems = total
144 ({ videos, totalVideos }) => { 145 this.videos = this.videos.concat(data)
145 this.pagination.totalItems = totalVideos
146 this.videos = this.videos.concat(videos)
147 146
148 if (this.groupByDate) this.buildGroupedDateLabels() 147 if (this.groupByDate) this.buildGroupedDateLabels()
149 148