From e43ead68323d15af2a0eec4c08e30ff310d14bad Mon Sep 17 00:00:00 2001 From: RCTrapdoor Date: Tue, 8 Oct 2013 16:42:42 +0200 Subject: [PATCH] Look at my sexy inline if statement, LOOK AT IT --- modules/youtube/youtube.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/youtube/youtube.js b/modules/youtube/youtube.js index 50ea949..27b6137 100644 --- a/modules/youtube/youtube.js +++ b/modules/youtube/youtube.js @@ -27,8 +27,7 @@ var youtube = function(dbot) { var v = body.feed.entry[0], seconds = v['media$group']['yt$duration'].seconds, minutes = Math.floor(seconds / 60), - seconds = seconds - minutes * 60; - if (seconds < 10) seconds = '0'+seconds; + seconds%60 < 10 ? seconds="0"+seconds%60 : seconds=seconds%60; if(!_.has(v, 'yt$rating')) { v['yt$rating'] = { @@ -69,8 +68,7 @@ var youtube = function(dbot) { var v = body.entry seconds = v['media$group']['yt$duration'].seconds, minutes = Math.floor(seconds / 60), - seconds = seconds - minutes * 60; - if (seconds < 10) seconds = '0'+seconds; + seconds%60 < 10 ? seconds="0"+seconds%60 : seconds=seconds%60; if(!_.has(v, 'yt$rating')) { v['yt$rating'] = {