From 6038443225a42ceb68816ea210ee19ed2b17dae1 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 21 Feb 2016 20:06:51 +0000 Subject: [PATCH] rookie mistake --- modules/rt/rt.js | 14 ++++++++++---- modules/rt/strings.json | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/rt/rt.js b/modules/rt/rt.js index ca48d45..fb4e758 100644 --- a/modules/rt/rt.js +++ b/modules/rt/rt.js @@ -11,14 +11,20 @@ var rt = function(dbot) { this.internalAPI = { 'formatLink': function(m) { - var rating = m.ratings.audience_score; - var rColour = (rating <= 5) ? '\u00033 ' : '\u00034 '; - rating = rColour + String(rating) + '%\u000f'; + var aRating = m.ratings.audience_score; + var cRating = m.ratings.critics_score; + + var aColour = (aRating <= 5) ? '\u00033 ' : '\u00034 '; + aRating = aColour + String(aRating) + '%\u000f'; + + var cColour = (cRating <= 5) ? '\u00033 ' : '\u00034 '; + cRating = cColour + String(cRating) + '%\u000f'; var mString = dbot.t('rt_film', { 'title': m.title, 'year': m.year, - 'rating': rating + 'audience_rating': aRating, + 'critic_rating': cRating }); if(_.has(m, 'directors')) mString += ' [Director: ' + m.directors[0] + ']'; diff --git a/modules/rt/strings.json b/modules/rt/strings.json index db1f16b..a0de776 100644 --- a/modules/rt/strings.json +++ b/modules/rt/strings.json @@ -1,6 +1,6 @@ { "rt_film": { - "en": "[{title} -{rating} - {year}]", + "en": "[{title} - Audience:{audience_rating} - Critic:{critic_rating} - {year}]", "de": "[{title} -{rating} - {year}]" }, "rt_noresults": {