UNPKG

nexshop-web-contents

Version:

Nexshop Web Contents Project

25 lines (24 loc) 828 B
export const createPlaylist = (name, contentItems, folderId, playlistResolutionItem, relatedContents) => { const {text, orientation} = playlistResolutionItem; let width = text.split('x')[0]; let height = text.split('x')[1]; let totalDurationSeconds = contentItems.reduce((accumulate, {durationSeconds}) => accumulate + durationSeconds, 0); let playlistThumbnailUrls = contentItems[0].contents.thumbnailUrls; return { name, metaData: { durationSeconds: totalDurationSeconds, contentItems, display: { resolution: { width, height }, orientation }, }, relatedContents, thumbnailUrls: playlistThumbnailUrls, folderId, tags: [], } };