Minor fixes

This commit is contained in:
ポール ウェッブ 2018-08-20 17:44:50 -05:00
parent 84d69d6ba8
commit 48c664d492
3 changed files with 18 additions and 34 deletions

View file

@ -10,17 +10,15 @@ const request = require("request-promise-native");
// E X P O R T
module.exports = exports = publishMetadata => new Promise((resolve, reject) => { // eslint-disable-line
return request({
body: {
authorization: process.env.LBRY_DAEMON_ACCESS_TOKEN,
metadata: publishMetadata
},
json: true,
method: "PUT",
url: `${process.env.NODE_ENV === "development" ? "http://localhost:5200/publish" : "https://daemon.lbry.tech/publish" }`
}, (error, response, body) => {
if (error) resolve(error);
resolve(body);
});
});
module.exports = exports = publishMetadata => new Promise((resolve, reject) => request({ // eslint-disable-line
body: {
authorization: process.env.LBRY_DAEMON_ACCESS_TOKEN,
metadata: publishMetadata
},
json: true,
method: "PUT",
url: `${process.env.NODE_ENV === "development" ? "http://localhost:5200/publish" : "https://daemon.lbry.tech/publish" }`
}, (error, response, body) => {
if (error) resolve(error);
resolve(body);
}));

View file

@ -5,7 +5,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@octokit/rest": "^15.9.5",
"@octokit/rest": "^15.10.0",
"app-root-path": "^2.1.0",
"async": "^2.6.1",
"choo": "^6.13.0",
@ -15,7 +15,7 @@
"choo-ssr": "^0.2.1",
"choo-websocket": "^2.0.0",
"cors": "^2.8.4",
"cron": "^1.3.0",
"cron": "^1.4.0",
"date-format-lite": "^17.7.0",
"decamelize": "^2.0.0",
"dedent": "^0.7.0",
@ -24,7 +24,7 @@
"fastify-compress": "^0.6.0",
"fastify-helmet": "^1.0.3",
"fastify-plugin": "^1.2.0",
"fastify-static": "^0.13.0",
"fastify-static": "^0.14.0",
"fastify-ws": "^1.0.0",
"front-matter": "^2.3.0",
"fs-exists-sync": "^0.1.0",
@ -42,8 +42,7 @@
"slack-node": "^0.1.8",
"socket.io": "^2.1.1",
"stringify-object": "^3.2.2",
"turbocolor": "^2.4.5",
"ws": "^6.0.0"
"turbocolor": "^2.6.1"
},
"devDependencies": {
"babel-preset-env": "^1.7.0",
@ -51,7 +50,7 @@
"choo-devtools": "^2.5.1",
"nodemon": "^1.18.3",
"npm-run-all": "^4.1.3",
"sass": "^1.11.0",
"sass": "^1.13.0",
"snazzy": "^7.1.1",
"standardx": "^2.1.0",
"updates": "^4.1.2"

View file

@ -218,19 +218,6 @@ function generateGitHubFeed(displayGitHubFeed) {
}
function generateMemeCreator(socket) {
/*
request({
body: { authorization: "hi" },
json: true,
method: "GET",
url: `${process.env.NODE_ENV === "development" ? "http://localhost:5200" : "https://daemon.lbry.tech"}`
}).then(body => {
console.log(body);
}).catch(welp => {
console.log(welp);
});
*/
const images = [
{
alt: "Carl Sagan",
@ -374,7 +361,7 @@ function generateTrendingContent(exampleNumber, displayTrendingContent) {
Promise.all(rawContentCollection).then(collection => {
for (const part of collection) {
if (!part.value.stream.metadata.nsfw && part.value.stream.metadata.thumbnail) {
if (!part.value.stream.metadata.nsfw && part.value.stream.metadata.thumbnail && part.channel_name) {
renderedContentCollection.push(`
<figure class="tour__content__trend">
<img alt="${part.name}" data-action="choose claim" data-claim-id="${exampleNumber === 1 ? part.name : part.claim_id}" src="${part.value.stream.metadata.thumbnail}"/>