import * as express from 'express'
-import { FEEDS, ROUTE_CACHE_LIFETIME, WEBSERVER } from '../initializers/constants'
-import { THUMBNAILS_SIZE } from '../initializers'
+import { FEEDS, ROUTE_CACHE_LIFETIME, THUMBNAILS_SIZE, WEBSERVER } from '../initializers/constants'
import {
asyncMiddleware,
commonVideosFiltersValidator,
async function generateVideoCommentsFeed (req: express.Request, res: express.Response) {
const start = 0
- const video = res.locals.video
+ const video = res.locals.videoAll
const videoId: number = video ? video.id : undefined
const comments = await VideoCommentModel.listForFeed(start, FEEDS.COUNT, videoId)
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,
}
],
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].filter(Boolean),
+ community: {
+ statistics: {
+ views: video.views
+ }
+ },
thumbnail: [
{
- url: WEBSERVER.URL + video.getThumbnailStaticPath(),
+ url: WEBSERVER.URL + video.getMiniatureStaticPath(),
height: THUMBNAILS_SIZE.height,
width: THUMBNAILS_SIZE.width
}