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

30 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
2019-02-23 06:52:31 +01:00
const createThumbnailPublishParams = (thumbnailFilePath, claimName, license, licenseUrl, nsfw) => {
2018-04-27 18:54:36 +02:00
if (!thumbnailFilePath) {
return;
}
logger.debug(`Creating Thumbnail Publish Parameters`);
// create the publish params
return {
2019-02-23 06:52:31 +01:00
name: `${claimName}-thumb`,
2018-04-27 18:54:36 +02:00
file_path: thumbnailFilePath,
2019-02-23 06:52:31 +01:00
bid: publishing.fileClaimBidAmount,
metadata: {
title: `${claimName} thumbnail`,
2018-04-27 18:54:36 +02:00
description: `a thumbnail for ${claimName}`,
2019-02-23 06:52:31 +01:00
author: details.title,
language: 'en',
2018-04-27 18:54:36 +02:00
license,
2019-02-23 06:52:31 +01:00
licenseUrl,
2018-04-27 18:54:36 +02:00
nsfw,
},
claim_address: publishing.primaryClaimAddress,
2019-02-23 06:52:31 +01:00
channel_name: publishing.thumbnailChannel,
channel_id: publishing.thumbnailChannelId,
2018-04-27 18:54:36 +02:00
};
};
module.exports = createThumbnailPublishParams;