From 0bd654364a66e372333e38e4242395d975435875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Sun, 12 Aug 2018 13:55:48 +0200 Subject: [PATCH] Fixed encoding-issue with channelnames --- server/apps/client.js | 5 +++++ server/public/partials/frontpage/channel.handlebars | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/server/apps/client.js b/server/apps/client.js index 80fd0f00..543065d0 100755 --- a/server/apps/client.js +++ b/server/apps/client.js @@ -21,6 +21,7 @@ var app = express(); var compression = require('compression'); var exphbs = require('express-handlebars'); var cors = require('cors'); +var Functions = require(pathThumbnails + '/handlers/functions.js'); var hbs = exphbs.create({ defaultLayout: publicPath + '/layouts/client/main', @@ -33,6 +34,10 @@ var hbs = exphbs.create({ } else { return opts.inverse(this) } + }, + decodeString: function(s) { + if(s == undefined) return s; + return Functions.decodeChannelName(s); } } diff --git a/server/public/partials/frontpage/channel.handlebars b/server/public/partials/frontpage/channel.handlebars index 520bc554..b12b8e76 100644 --- a/server/public/partials/frontpage/channel.handlebars +++ b/server/public/partials/frontpage/channel.handlebars @@ -8,7 +8,7 @@ star_rate

- {{_id}} + {{decodeString _id}}
Viewers:  {{viewers}} @@ -23,7 +23,7 @@ {{#if_equal description "This list has no description"}} {{else}}

- {{_id}} + {{decodeString _id}}

{{description}}

{{/if_equal}}