diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-05 09:15:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-05 09:15:41 +0200 |
commit | 7557704eec3995092136b87154a1fbe644bc0fec (patch) | |
tree | 88ae13fc67dc49774d2124c299b64798439c63a6 /server/models | |
parent | 1a2820e6e834b50274b785fa507950ed17e100df (diff) | |
download | PeerTube-7557704eec3995092136b87154a1fbe644bc0fec.tar.gz PeerTube-7557704eec3995092136b87154a1fbe644bc0fec.tar.zst PeerTube-7557704eec3995092136b87154a1fbe644bc0fec.zip |
Fix compat with peertube 2.1
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video-format-utils.ts | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 0d3c5a8ac..d71a3a5db 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -323,7 +323,10 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject { | |||
323 | }) | 323 | }) |
324 | } | 324 | } |
325 | 325 | ||
326 | const icons = [ video.getMiniature(), video.getPreview() ] | 326 | // FIXME: remove and uncomment in PT 2.3 |
327 | // Breaks compatibility with PT <= 2.1 | ||
328 | // const icons = [ video.getMiniature(), video.getPreview() ] | ||
329 | const miniature = video.getMiniature() | ||
327 | 330 | ||
328 | return { | 331 | return { |
329 | type: 'Video' as 'Video', | 332 | type: 'Video' as 'Video', |
@@ -348,13 +351,20 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject { | |||
348 | content: video.getTruncatedDescription(), | 351 | content: video.getTruncatedDescription(), |
349 | support: video.support, | 352 | support: video.support, |
350 | subtitleLanguage, | 353 | subtitleLanguage, |
351 | icon: icons.map(i => ({ | 354 | icon: { |
352 | type: 'Image', | 355 | type: 'Image', |
353 | url: i.getFileUrl(video), | 356 | url: miniature.getFileUrl(video), |
354 | mediaType: 'image/jpeg', | 357 | mediaType: 'image/jpeg', |
355 | width: i.width, | 358 | width: miniature.width, |
356 | height: i.height | 359 | height: miniature.height |
357 | })), | 360 | } as any, |
361 | // icon: icons.map(i => ({ | ||
362 | // type: 'Image', | ||
363 | // url: i.getFileUrl(video), | ||
364 | // mediaType: 'image/jpeg', | ||
365 | // width: i.width, | ||
366 | // height: i.height | ||
367 | // })), | ||
358 | url, | 368 | url, |
359 | likes: getVideoLikesActivityPubUrl(video), | 369 | likes: getVideoLikesActivityPubUrl(video), |
360 | dislikes: getVideoDislikesActivityPubUrl(video), | 370 | dislikes: getVideoDislikesActivityPubUrl(video), |