missing data fix for youtube

This commit is contained in:
reality 2013-07-28 10:41:08 +00:00
parent e3b35adb1c
commit b1916d6043

View File

@ -65,6 +65,10 @@ var youtube = function(dbot) {
'numDislikes': 0 'numDislikes': 0
}; };
} }
if(!_.has(v, 'yt$statistics')) {
v['yt$statistics'] = { 'viewCount': 0 };
}
callback(dbot.t('yt_video', { callback(dbot.t('yt_video', {
'title': v.title['$t'], 'title': v.title['$t'],
'plays': v['yt$statistics'].viewCount, 'plays': v['yt$statistics'].viewCount,