From b81eb8fdc6fabbe517d5731c26da773206ebba62 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 29 Jun 2018 14:40:39 +0200 Subject: (feed) adding thumbnail support for RSS feed --- package.json | 2 +- server/controllers/feeds.ts | 10 +++++++++- yarn.lock | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 254281df5..cbe269e7d 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "parse-torrent": "^6.0.0", "password-generator": "^2.0.2", "pem": "^1.12.3", - "pfeed": "^1.1.5", + "pfeed": "^1.1.6", "pg": "^7.4.1", "pg-hstore": "^2.3.2", "redis": "^2.8.0", diff --git a/server/controllers/feeds.ts b/server/controllers/feeds.ts index ce57e5c11..1773fc71e 100644 --- a/server/controllers/feeds.ts +++ b/server/controllers/feeds.ts @@ -1,5 +1,6 @@ import * as express from 'express' import { CONFIG, FEEDS, ROUTE_CACHE_LIFETIME } from '../initializers/constants' +import { THUMBNAILS_SIZE } from '../initializers' import { asyncMiddleware, setDefaultSort, videoCommentsFeedsValidator, videoFeedsValidator, videosSortValidator } from '../middlewares' import { VideoModel } from '../models/video/video' import * as Feed from 'pfeed' @@ -125,7 +126,14 @@ async function generateVideoFeed (req: express.Request, res: express.Response, n date: video.publishedAt, language: video.language, nsfw: video.nsfw, - torrent: torrents + torrent: torrents, + thumbnail: [ + { + url: CONFIG.WEBSERVER.URL + video.getThumbnailPath(), + height: THUMBNAILS_SIZE.height, + width: THUMBNAILS_SIZE.width + } + ] }) }) diff --git a/yarn.lock b/yarn.lock index 8c79ab282..a341e56eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5426,9 +5426,9 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" -pfeed@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.5.tgz#6d0ab54209c60b45de03a15efaab7be867a3f71a" +pfeed@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/pfeed/-/pfeed-1.1.6.tgz#0de2a1c40b116fa236227237fa264c7956c185e8" dependencies: xml "^1.0.1" -- cgit v1.2.3