Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Prevent thumbnail crash for podcasts

Chocobozzz2aede7ef1390
diff --git a/server/core/controllers/feeds/shared/video-feed-utils.ts b/server/core/controllers/feeds/shared/video-feed-utils.ts
index ffad21675f..8847b5af8b 100644
--- a/server/core/controllers/feeds/shared/video-feed-utils.ts
+++ b/server/core/controllers/feeds/shared/video-feed-utils.ts
@@ -46,6 +46,9 @@ export async function getVideosForFeeds (options: {
export function getCommonVideoFeedAttributes (video: VideoModel) {
const localLink = WEBSERVER.URL + video.getWatchStaticPath()
+ let thumbnails = video.filterThumbnails('1:1')
+ if (thumbnails.length === 0) thumbnails = video.filterThumbnails('16:9')
+
return {
title: video.name,
link: localLink,
@@ -59,7 +62,7 @@ export function getCommonVideoFeedAttributes (video: VideoModel) {
? [ { name: getCategoryLabel(video.category) } ]
: undefined,
- thumbnails: video.filterThumbnails('1:1').map(t => ({
+ thumbnails: thumbnails.map(t => ({
url: WEBSERVER.URL + t.getFileStaticPath(),
width: t.width,
height: t.height