diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2019-12-03 16:11:04 +0100 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2019-12-03 16:11:10 +0100 |
commit | 16d9224a1c275a824b4bb3fc0466296bc2c37205 (patch) | |
tree | 92c969ddfa7a80f2a45483ef755d9cdc232e22dc | |
parent | a5a254c4b867b97d98978bd506f0af95adb51886 (diff) | |
download | PeerTube-16d9224a1c275a824b4bb3fc0466296bc2c37205.tar.gz PeerTube-16d9224a1c275a824b4bb3fc0466296bc2c37205.tar.zst PeerTube-16d9224a1c275a824b4bb3fc0466296bc2c37205.zip |
(rss) add mrss properties and update pfeed
resolves #2298
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | server/controllers/feeds.ts | 29 | ||||
-rw-r--r-- | yarn.lock | 8 |
3 files changed, 33 insertions, 6 deletions
diff --git a/package.json b/package.json index dfae286e0..941fc3ea8 100644 --- a/package.json +++ b/package.json | |||
@@ -138,7 +138,7 @@ | |||
138 | "parse-torrent": "^7.0.0", | 138 | "parse-torrent": "^7.0.0", |
139 | "password-generator": "^2.0.2", | 139 | "password-generator": "^2.0.2", |
140 | "pem": "^1.12.3", | 140 | "pem": "^1.12.3", |
141 | "pfeed": "^1.1.6", | 141 | "pfeed": "1.1.10", |
142 | "pg": "^7.4.1", | 142 | "pg": "^7.4.1", |
143 | "prompt": "^1.0.0", | 143 | "prompt": "^1.0.0", |
144 | "redis": "^2.8.0", | 144 | "redis": "^2.8.0", |
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) { | |||
118 | url: videoFile.torrentUrl, | 118 | url: videoFile.torrentUrl, |
119 | size_in_bytes: videoFile.size | 119 | size_in_bytes: videoFile.size |
120 | })) | 120 | })) |
121 | const videos = formattedVideoFiles.map(videoFile => (Object.assign({ | ||
122 | type: 'video/mp4', | ||
123 | medium: 'video', | ||
124 | height: videoFile.resolution.label.replace('p', ''), | ||
125 | fileSize: videoFile.size, | ||
126 | url: videoFile.fileUrl, | ||
127 | framerate: videoFile.fps, | ||
128 | duration: video.duration | ||
129 | }, video.language ? { | ||
130 | lang: video.language | ||
131 | } : {}))) | ||
121 | 132 | ||
122 | feed.addItem({ | 133 | feed.addItem({ |
123 | title: video.name, | 134 | title: video.name, |
@@ -132,9 +143,25 @@ async function generateVideoFeed (req: express.Request, res: express.Response) { | |||
132 | } | 143 | } |
133 | ], | 144 | ], |
134 | date: video.publishedAt, | 145 | date: video.publishedAt, |
135 | language: video.language, | ||
136 | nsfw: video.nsfw, | 146 | nsfw: video.nsfw, |
137 | torrent: torrents, | 147 | torrent: torrents, |
148 | videos, | ||
149 | embed: { | ||
150 | url: video.getEmbedStaticPath(), | ||
151 | allowFullscreen: true | ||
152 | }, | ||
153 | player: { | ||
154 | url: video.getWatchStaticPath() | ||
155 | }, | ||
156 | categories: [video.category ? { | ||
157 | value: video.category, | ||
158 | label: VideoModel.getCategoryLabel(video.category) | ||
159 | } : null], | ||
160 | community: { | ||
161 | statistics: { | ||
162 | views: video.views | ||
163 | } | ||
164 | }, | ||
138 | thumbnail: [ | 165 | thumbnail: [ |
139 | { | 166 | { |
140 | url: WEBSERVER.URL + video.getMiniatureStaticPath(), | 167 | url: WEBSERVER.URL + video.getMiniatureStaticPath(), |
@@ -4911,10 +4911,10 @@ performance-now@^2.1.0: | |||
4911 | resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" | 4911 | resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" |
4912 | integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= | 4912 | integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= |
4913 | 4913 | ||
4914 | pfeed@^1.1.6: | 4914 | pfeed@1.1.10: |
4915 | version "1.1.9" | 4915 | version "1.1.10" |
4916 | resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.9.tgz#62225ff674e154aa3d665afa9d85df71f088807e" | 4916 | resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.10.tgz#9550017c61925e73b18c6fe3d6c6329d4d41d75f" |
4917 | integrity sha512-xAm85IdpLNcVp3Q7QyzAe1ncb9REZVdNcQNLYyF8+QiFuy0wDcxGYrqphI2ga6rs1m4sFfhiGZv6iwXdZDQJXA== | 4917 | integrity sha512-Gv13vtX/6Bac+NxWOYauLCW4br7QaooKUcGHOhKn0SSaYZc5cx2vT5P5hs4533su9uf8VnlLi44VzXodWnQYNg== |
4918 | dependencies: | 4918 | dependencies: |
4919 | lodash "^4.17.15" | 4919 | lodash "^4.17.15" |
4920 | xml "^1.0.1" | 4920 | xml "^1.0.1" |