Fix compat with peertube 2.1
This commit is contained in:
parent
1a2820e6e8
commit
7557704eec
|
@ -323,7 +323,10 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const icons = [ video.getMiniature(), video.getPreview() ]
|
// FIXME: remove and uncomment in PT 2.3
|
||||||
|
// Breaks compatibility with PT <= 2.1
|
||||||
|
// const icons = [ video.getMiniature(), video.getPreview() ]
|
||||||
|
const miniature = video.getMiniature()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'Video' as 'Video',
|
type: 'Video' as 'Video',
|
||||||
|
@ -348,13 +351,20 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject {
|
||||||
content: video.getTruncatedDescription(),
|
content: video.getTruncatedDescription(),
|
||||||
support: video.support,
|
support: video.support,
|
||||||
subtitleLanguage,
|
subtitleLanguage,
|
||||||
icon: icons.map(i => ({
|
icon: {
|
||||||
type: 'Image',
|
type: 'Image',
|
||||||
url: i.getFileUrl(video),
|
url: miniature.getFileUrl(video),
|
||||||
mediaType: 'image/jpeg',
|
mediaType: 'image/jpeg',
|
||||||
width: i.width,
|
width: miniature.width,
|
||||||
height: i.height
|
height: miniature.height
|
||||||
})),
|
} as any,
|
||||||
|
// icon: icons.map(i => ({
|
||||||
|
// type: 'Image',
|
||||||
|
// url: i.getFileUrl(video),
|
||||||
|
// mediaType: 'image/jpeg',
|
||||||
|
// width: i.width,
|
||||||
|
// height: i.height
|
||||||
|
// })),
|
||||||
url,
|
url,
|
||||||
likes: getVideoLikesActivityPubUrl(video),
|
likes: getVideoLikesActivityPubUrl(video),
|
||||||
dislikes: getVideoDislikesActivityPubUrl(video),
|
dislikes: getVideoDislikesActivityPubUrl(video),
|
||||||
|
|
Loading…
Reference in New Issue