diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-04 15:22:08 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-06-04 15:22:08 +0200 |
commit | 4282dafc826f5ca72598aa5446122eb6da3aed27 (patch) | |
tree | a12b1b32f7957621bad01753bd0aed6185e0d127 | |
parent | 5cb9f0f4f754a36de0c1844783867f2088adfaed (diff) | |
download | PeerTube-4282dafc826f5ca72598aa5446122eb6da3aed27.tar.gz PeerTube-4282dafc826f5ca72598aa5446122eb6da3aed27.tar.zst PeerTube-4282dafc826f5ca72598aa5446122eb6da3aed27.zip |
Add AP icons breaking change
-rw-r--r-- | server/models/video/video-format-utils.ts | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 8bc696055..89b0f5050 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -327,10 +327,7 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject { | |||
327 | }) | 327 | }) |
328 | } | 328 | } |
329 | 329 | ||
330 | // FIXME: remove and uncomment in PT 2.3 | 330 | const icons = [ video.getMiniature(), video.getPreview() ] |
331 | // Breaks compatibility with PT <= 2.1 | ||
332 | // const icons = [ video.getMiniature(), video.getPreview() ] | ||
333 | const miniature = video.getMiniature() | ||
334 | 331 | ||
335 | return { | 332 | return { |
336 | type: 'Video' as 'Video', | 333 | type: 'Video' as 'Video', |
@@ -355,20 +352,13 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject { | |||
355 | content: video.description, | 352 | content: video.description, |
356 | support: video.support, | 353 | support: video.support, |
357 | subtitleLanguage, | 354 | subtitleLanguage, |
358 | icon: { | 355 | icon: icons.map(i => ({ |
359 | type: 'Image', | 356 | type: 'Image', |
360 | url: miniature.getFileUrl(video), | 357 | url: i.getFileUrl(video), |
361 | mediaType: 'image/jpeg', | 358 | mediaType: 'image/jpeg', |
362 | width: miniature.width, | 359 | width: i.width, |
363 | height: miniature.height | 360 | height: i.height |
364 | } as any, | 361 | })), |
365 | // icon: icons.map(i => ({ | ||
366 | // type: 'Image', | ||
367 | // url: i.getFileUrl(video), | ||
368 | // mediaType: 'image/jpeg', | ||
369 | // width: i.width, | ||
370 | // height: i.height | ||
371 | // })), | ||
372 | url, | 362 | url, |
373 | likes: getVideoLikesActivityPubUrl(video), | 363 | likes: getVideoLikesActivityPubUrl(video), |
374 | dislikes: getVideoDislikesActivityPubUrl(video), | 364 | dislikes: getVideoDislikesActivityPubUrl(video), |