]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add AP icons breaking change
authorChocobozzz <me@florianbigard.com>
Thu, 4 Jun 2020 13:22:08 +0000 (15:22 +0200)
committerChocobozzz <me@florianbigard.com>
Thu, 4 Jun 2020 13:22:08 +0000 (15:22 +0200)
server/models/video/video-format-utils.ts

index 8bc69605567ab6fc2a1c6fa2618542150ebb8a82..89b0f50500b3cd0a39da31386d27b3b9870d0279 100644 (file)
@@ -327,10 +327,7 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject {
     })
   }
 
-  // FIXME: remove and uncomment in PT 2.3
-  // Breaks compatibility with PT <= 2.1
-  // const icons = [ video.getMiniature(), video.getPreview() ]
-  const miniature = video.getMiniature()
+  const icons = [ video.getMiniature(), video.getPreview() ]
 
   return {
     type: 'Video' as 'Video',
@@ -355,20 +352,13 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject {
     content: video.description,
     support: video.support,
     subtitleLanguage,
-    icon: {
+    icon: icons.map(i => ({
       type: 'Image',
-      url: miniature.getFileUrl(video),
+      url: i.getFileUrl(video),
       mediaType: 'image/jpeg',
-      width: miniature.width,
-      height: miniature.height
-    } as any,
-    // icon: icons.map(i => ({
-    //   type: 'Image',
-    //   url: i.getFileUrl(video),
-    //   mediaType: 'image/jpeg',
-    //   width: i.width,
-    //   height: i.height
-    // })),
+      width: i.width,
+      height: i.height
+    })),
     url,
     likes: getVideoLikesActivityPubUrl(video),
     dislikes: getVideoDislikesActivityPubUrl(video),