]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video-blacklist/video-blacklist.service.ts
Set a default background color for account avatar
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video-blacklist / video-blacklist.service.ts
index a9eab9b6fa8c679e80befd29dc813ce9b8ae8f2a..491fa698b722d6f64a61c5ad8beb63d87b555dc2 100644 (file)
@@ -7,7 +7,7 @@ import { VideoBlacklist, VideoBlacklistType, ResultList } from '../../../../../s
 import { Video } from '../video/video.model'
 import { environment } from '../../../environments/environment'
 import { RestExtractor, RestPagination, RestService } from '../rest'
-import { ComponentPagination } from '../rest/component-pagination.model'
+import { ComponentPaginationLight } from '../rest/component-pagination.model'
 
 @Injectable()
 export class VideoBlacklistService {
@@ -34,7 +34,7 @@ export class VideoBlacklistService {
                )
   }
 
-  getAutoBlacklistedAsVideoList (videoPagination: ComponentPagination): Observable<{ videos: Video[], totalVideos: number}> {
+  getAutoBlacklistedAsVideoList (videoPagination: ComponentPaginationLight): Observable<ResultList<Video>> {
     const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
 
     // prioritize first created since waiting longest
@@ -48,9 +48,10 @@ export class VideoBlacklistService {
     return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlacklistService.BASE_VIDEOS_URL + 'blacklist', { params })
               .pipe(
                 map(res => {
-                  const videos = res.data.map(videoBlacklist => new Video(videoBlacklist.video))
-                  const totalVideos = res.total
-                  return { videos, totalVideos }
+                  return {
+                    total: res.total,
+                    data: res.data.map(videoBlacklist => new Video(videoBlacklist.video))
+                  }
                 }),
                 catchError(res => this.restExtractor.handleError(res))
               )