3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00

Look at my sexy inline if statement, LOOK AT IT

This commit is contained in:
RCTrapdoor 2013-10-08 16:42:42 +02:00
parent bf0c277ad6
commit e43ead6832

View File

@ -27,8 +27,7 @@ var youtube = function(dbot) {
var v = body.feed.entry[0], var v = body.feed.entry[0],
seconds = v['media$group']['yt$duration'].seconds, seconds = v['media$group']['yt$duration'].seconds,
minutes = Math.floor(seconds / 60), minutes = Math.floor(seconds / 60),
seconds = seconds - minutes * 60; seconds%60 < 10 ? seconds="0"+seconds%60 : seconds=seconds%60;
if (seconds < 10) seconds = '0'+seconds;
if(!_.has(v, 'yt$rating')) { if(!_.has(v, 'yt$rating')) {
v['yt$rating'] = { v['yt$rating'] = {
@ -69,8 +68,7 @@ var youtube = function(dbot) {
var v = body.entry var v = body.entry
seconds = v['media$group']['yt$duration'].seconds, seconds = v['media$group']['yt$duration'].seconds,
minutes = Math.floor(seconds / 60), minutes = Math.floor(seconds / 60),
seconds = seconds - minutes * 60; seconds%60 < 10 ? seconds="0"+seconds%60 : seconds=seconds%60;
if (seconds < 10) seconds = '0'+seconds;
if(!_.has(v, 'yt$rating')) { if(!_.has(v, 'yt$rating')) {
v['yt$rating'] = { v['yt$rating'] = {