From 6158ef97242f4e876c842dd9bd8625064d6d3214 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Mon, 11 Sep 2017 12:54:36 -0700 Subject: [PATCH] moved all thumbnail url decisions to server-side --- controllers/serveController.js | 3 +++ controllers/statsController.js | 2 +- views/partials/contentListItem.handlebars | 6 +----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/controllers/serveController.js b/controllers/serveController.js index 4b99e03d..9ef246f7 100644 --- a/controllers/serveController.js +++ b/controllers/serveController.js @@ -157,6 +157,9 @@ module.exports = { element['showUrlLong'] = `/${channelName}:${longChannelId}/${element.name}`; element['directUrlLong'] = `/${channelName}:${longChannelId}/${element.name}.${fileExtenstion}`; element['directUrlShort'] = `/${channelName}:${shortChannelId}/${element.name}.${fileExtenstion}`; + if (!element.thumbnail || element.thumbnail === '') { + element['thumbnail'] = 'https://spee.ch/assets/img/content-freedom-large.png'; + } }); } return resolve(allChannelClaims); diff --git a/controllers/statsController.js b/controllers/statsController.js index 413bf0ff..915c9d81 100644 --- a/controllers/statsController.js +++ b/controllers/statsController.js @@ -155,7 +155,7 @@ module.exports = { element['directUrlLong'] = `/${element.claimId}/${element.name}.${fileExtenstion}`; element['directUrlShort'] = `/${element.claimId}/${element.name}.${fileExtenstion}`; element['contentType'] = element.fileType; - element['thumbnail'] = ''; + element['thumbnail'] = 'https://spee.ch/assets/img/content-freedom-large.png'; }); } resolve(results); diff --git a/views/partials/contentListItem.handlebars b/views/partials/contentListItem.handlebars index 895abfbd..128241c5 100644 --- a/views/partials/contentListItem.handlebars +++ b/views/partials/contentListItem.handlebars @@ -1,11 +1,7 @@
{{#ifConditional this.contentType '===' 'video/mp4'}} - {{#ifConditional this.thumbnail '===' ''}} - - {{else}} - - {{/ifConditional}} + {{else}} {{/ifConditional}}