(rss) add mrss properties and update pfeed

resolves #2298
pull/2306/head
Rigel Kent 2019-12-03 16:11:04 +01:00
parent a5a254c4b8
commit 16d9224a1c
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
3 changed files with 33 additions and 6 deletions

View File

@ -138,7 +138,7 @@
"parse-torrent": "^7.0.0",
"password-generator": "^2.0.2",
"pem": "^1.12.3",
"pfeed": "^1.1.6",
"pfeed": "1.1.10",
"pg": "^7.4.1",
"prompt": "^1.0.0",
"redis": "^2.8.0",

View File

@ -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(),

View File

@ -4911,10 +4911,10 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=
pfeed@^1.1.6:
version "1.1.9"
resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.9.tgz#62225ff674e154aa3d665afa9d85df71f088807e"
integrity sha512-xAm85IdpLNcVp3Q7QyzAe1ncb9REZVdNcQNLYyF8+QiFuy0wDcxGYrqphI2ga6rs1m4sFfhiGZv6iwXdZDQJXA==
pfeed@1.1.10:
version "1.1.10"
resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.10.tgz#9550017c61925e73b18c6fe3d6c6329d4d41d75f"
integrity sha512-Gv13vtX/6Bac+NxWOYauLCW4br7QaooKUcGHOhKn0SSaYZc5cx2vT5P5hs4533su9uf8VnlLi44VzXodWnQYNg==
dependencies:
lodash "^4.17.15"
xml "^1.0.1"