From 16d9224a1c275a824b4bb3fc0466296bc2c37205 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 3 Dec 2019 16:11:04 +0100 Subject: (rss) add mrss properties and update pfeed resolves #2298 --- server/controllers/feeds.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index 468f7a668..7207baa00 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts @@ -118,6 +118,17 @@ async function generateVideoFeed (req: express.Request, res: express.Response) { url: videoFile.torrentUrl, size_in_bytes: videoFile.size })) + const videos = formattedVideoFiles.map(videoFile => (Object.assign({ + type: 'video/mp4', + medium: 'video', + height: videoFile.resolution.label.replace('p', ''), + fileSize: videoFile.size, + url: videoFile.fileUrl, + framerate: videoFile.fps, + duration: video.duration + }, video.language ? { + lang: video.language + } : {}))) feed.addItem({ title: video.name, @@ -132,9 +143,25 @@ async function generateVideoFeed (req: express.Request, res: express.Response) { } ], date: video.publishedAt, - language: video.language, nsfw: video.nsfw, torrent: torrents, + videos, + embed: { + url: video.getEmbedStaticPath(), + allowFullscreen: true + }, + player: { + url: video.getWatchStaticPath() + }, + categories: [video.category ? { + value: video.category, + label: VideoModel.getCategoryLabel(video.category) + } : null], + community: { + statistics: { + views: video.views + } + }, thumbnail: [ { url: WEBSERVER.URL + video.getMiniatureStaticPath(), -- cgit v1.2.3