spee.ch/server/controllers/api/claim/publish/createThumbnailPublishParams.js

29 lines
858 B
JavaScript
Raw Normal View History

2018-04-27 18:54:36 +02:00
const logger = require('winston');
2018-06-06 04:34:24 +02:00
const { details, publishing } = require('@config/siteConfig');
2018-04-27 18:54:36 +02:00
const createThumbnailPublishParams = (thumbnailFilePath, claimName, license, nsfw) => {
if (!thumbnailFilePath) {
return;
}
logger.debug(`Creating Thumbnail Publish Parameters`);
// create the publish params
return {
name : `${claimName}-thumb`,
file_path: thumbnailFilePath,
2018-11-01 04:59:01 +01:00
bid : publishing.fileClaimBidAmount,
2018-04-27 18:54:36 +02:00
metadata : {
title : `${claimName} thumbnail`,
description: `a thumbnail for ${claimName}`,
author : details.title,
language : 'en',
license,
nsfw,
},
claim_address: publishing.primaryClaimAddress,
channel_name : publishing.thumbnailChannel,
channel_id : publishing.thumbnailChannelId,
};
};
module.exports = createThumbnailPublishParams;