]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix auto blacklist view
authorChocobozzz <me@florianbigard.com>
Wed, 4 Sep 2019 13:03:50 +0000 (15:03 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 4 Sep 2019 13:03:50 +0000 (15:03 +0200)
client/src/app/shared/video-blacklist/video-blacklist.service.ts
client/src/app/shared/video/video-miniature.component.html
client/src/app/shared/video/video-miniature.component.ts
server/models/video/video-blacklist.ts

index a9eab9b6fa8c679e80befd29dc813ce9b8ae8f2a..d65da85fe307c0a95b7cc6a7212bc13209f5bec6 100644 (file)
@@ -34,7 +34,7 @@ export class VideoBlacklistService {
                )
   }
 
-  getAutoBlacklistedAsVideoList (videoPagination: ComponentPagination): Observable<{ videos: Video[], totalVideos: number}> {
+  getAutoBlacklistedAsVideoList (videoPagination: ComponentPagination): 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))
               )
index 51ca1393dfb8735e558fd69d2a735f51a665f3e2..5d5691b7573d20546f1fbd73e0ce5f2a03be57ca 100644 (file)
@@ -31,7 +31,7 @@
 
       <div class="video-info-privacy">
         <ng-container *ngIf="displayOptions.privacyText">{{ video.privacy.label }}</ng-container>
-        <ng-container *ngIf="displayOptions.privacyText && getStateLabel(video)"> - </ng-container>
+        <ng-container *ngIf="displayOptions.privacyText && displayOptions.state && getStateLabel(video)"> - </ng-container>
         <ng-container *ngIf="displayOptions.state">{{ getStateLabel(video) }}</ng-container>
       </div>
 
index 48475033cc180c1e0c05d37f04867f7e77addf96..d5c7dfd9b580cef5b3515f7dbfb4df4dedc9555e 100644 (file)
@@ -95,6 +95,8 @@ export class VideoMiniatureComponent implements OnInit {
   }
 
   getStateLabel (video: Video) {
+    if (!video.state) return ''
+
     if (video.privacy.id !== VideoPrivacy.PRIVATE && video.state.id === VideoState.PUBLISHED) {
       return this.i18n('Published')
     }
index 22d949da0f75723b1ad7b826e1cde03b357895e2..18a1b8b4b95751ae9815d743f515cbbd5cb2b4e6 100644 (file)
@@ -64,7 +64,6 @@ export class VideoBlacklistModel extends Model<VideoBlacklistModel> {
     const countQuery = buildBaseQuery()
 
     const findQuery = buildBaseQuery()
-    findQuery.subQuery = false
     findQuery.include = [
       {
         model: VideoModel,