]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add object storage info badge
authorChocobozzz <me@florianbigard.com>
Mon, 10 Oct 2022 12:42:51 +0000 (14:42 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 10 Oct 2022 12:42:51 +0000 (14:42 +0200)
client/src/app/+admin/overview/videos/video-list.component.html
client/src/app/+admin/overview/videos/video-list.component.ts

index 14bbb55e9bcfec629476eb9241a0f153e282ec27..fb5e533f17837943f08247a0182d7dbe261e115f 100644 (file)
@@ -85,7 +85,8 @@
       <td>
         <span *ngIf="isHLS(video)" class="pt-badge badge-blue">HLS</span>
         <span *ngIf="isWebTorrent(video)" class="pt-badge badge-blue">WebTorrent ({{ video.files.length }})</span>
-        <span *ngIf="video.isLive" class="pt-badge badge-blue">Live</span>
+        <span i18n *ngIf="video.isLive" class="pt-badge badge-blue">Live</span>
+        <span i18n *ngIf="hasObjectStorage(video)" class="pt-badge badge-purple">Object storage</span>
 
         <span *ngIf="!isImport(video) && !video.isLive && video.isLocal">{{ getFilesSize(video) | bytes: 1 }}</span>
       </td>
index cb693ce12dd1690830cf33006d83438a128b520a..4d3e9873cbf6a6a9fa47879524f1bdb94bb85b29 100644 (file)
@@ -8,6 +8,7 @@ import { AdvancedInputFilter } from '@app/shared/shared-forms'
 import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
 import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation'
 import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature'
+import { getAllFiles } from '@shared/core-utils'
 import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models'
 import { VideoAdminService } from './video-admin.service'
 
@@ -166,6 +167,14 @@ export class VideoListComponent extends RestTable implements OnInit {
     return video.files.length !== 0
   }
 
+  hasObjectStorage (video: Video) {
+    if (!video.isLocal) return false
+
+    const files = getAllFiles(video)
+
+    return files.some(f => !f.fileUrl.startsWith(window.location.origin))
+  }
+
   canRemoveOneFile (video: Video) {
     return video.canRemoveOneFile(this.authUser)
   }