(rss) add mrss properties and update pfeed
authorRigel Kent <sendmemail@rigelk.eu>
Tue, 3 Dec 2019 15:11:04 +0000 (16:11 +0100)
committerRigel Kent <sendmemail@rigelk.eu>
Tue, 3 Dec 2019 15:11:10 +0000 (16:11 +0100)
resolves #2298

package.json
server/controllers/feeds.ts
yarn.lock

index dfae286e0166406ec8f61c70e5705cb50f356c71..941fc3ea84425ffd1015475876f321d598066d02 100644 (file)
     "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",
index 468f7a668dc1a43fe75b72fff956bdc072b31a93..7207baa006b60ad300702c2183c825e8a2a6d959 100644 (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(),
index 466397fd2aadb2567fffc27935ad057a2713d7cb..fd58b3c4aa410b7dfee7be042838474eeb5cd223 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -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"