From 70e292f39a92f943963d1f54310f490df75ee1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=AB=20=E3=82=A6=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=83=96?= Date: Thu, 9 Aug 2018 09:38:42 -0500 Subject: [PATCH] NSFW content is not shown on Tour --- helpers/fetch-metadata.js | 25 ++++--------------------- server.js | 2 +- views/pages/home.js | 2 +- views/partials/tour-scripts.js | 7 ++++++- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/helpers/fetch-metadata.js b/helpers/fetch-metadata.js index dead8ee..9904d04 100644 --- a/helpers/fetch-metadata.js +++ b/helpers/fetch-metadata.js @@ -29,40 +29,23 @@ module.exports = exports = (data, socket) => { if (data.step === 2 && !data.data) return; if (data.step === 2) dataDetails = data.data; // file upload - const claimAddress = data.claim; - const resolveMethod = data.method; - - /* - const allowedClaims = [ - "fortnite-top-stream-moments-nickatnyte", - "hellolbry", - "itsadisaster", - "six", - "unbubbled1-1" - ]; - */ - const allowedMethods = [ "publish", "resolve", "wallet_send" ]; + const body = {}; + const claimAddress = data.claim; + const resolveMethod = data.method; + if (allowedMethods.indexOf(resolveMethod) < 0) return socket.send(JSON.stringify({ "details": "Unallowed resolve method for tutorial", "message": "notification", "type": "error" })); - /* - if (data.step === 1 && allowedClaims.indexOf(claimAddress) < 0) return socket.send(JSON.stringify({ - "details": "Invalid claim ID for tutorial", - "message": "notification", - "type": "error" - })); - */ - const body = {}; body.access_token = process.env.LBRY_DAEMON_ACCESS_TOKEN; body.method = resolveMethod; diff --git a/server.js b/server.js index 75bce24..c4bc655 100755 --- a/server.js +++ b/server.js @@ -295,7 +295,7 @@ function generateStep1OfTour(displayTrendingContent) { Promise.all(rawContentCollection).then(collection => { for (const part of collection) { - if (part.value.stream.metadata.thumbnail) { + if (!part.value.stream.metadata.nsfw && part.value.stream.metadata.thumbnail) { renderedContentCollection.push(`
${part.name} diff --git a/views/pages/home.js b/views/pages/home.js index bf59448..ff19815 100755 --- a/views/pages/home.js +++ b/views/pages/home.js @@ -25,7 +25,7 @@ module.exports = exports = () => async () => html`