'use strict';
const R = require('ramda');
module.exports = R.curry(tuple => {
const video = tuple[1];
const staticContent = !R.isNil(tuple[0].static_content) ? tuple[0].static_content : {};
const attributes = R.merge({
subType: video.sub_type,
videoId: video.video_id,
title: video.title
}, staticContent);
const meta = R.merge(tuple[0], {
"type": "video",
"lastModifiedDate": video.last_modified_date || video.updated_at,
"id": video.id
});
return [meta, {
data: {
type: 'video',
id: video.escenic_id,
attributes: attributes,
links: {
screenshotUrl: video.thumbnail_url
}
}
}];
});
|