Fixed: Don't show an error if filesize cannot be formatted

pull/3113/head
Mark McDowall 11 years ago
parent fbdc84b6cd
commit 14f57d655a

@ -50,15 +50,15 @@ define(
var title = 'Episode downloaded'; var title = 'Episode downloaded';
if (quality.proper) { if (quality.proper) {
title += ' [PROPER] - {0}'.format(size); title += ' [PROPER]';
this.$el.html('<span class="badge badge-info" title="{0}">{1}</span>'.format(title, quality.quality.name));
} }
else { if (size !== '') {
title += ' - {0}'.format(size); title += ' - {0}'.format(size);
this.$el.html('<span class="badge badge-inverse" title="{0}">{1}</span>'.format(title, quality.quality.name));
} }
this.$el.html('<span class="badge badge-inverse" title="{0}">{1}</span>'.format(title, quality.quality.name));
return; return;
} }

@ -10,6 +10,11 @@ define(
bytes: function (sourceSize) { bytes: function (sourceSize) {
var size = Number(sourceSize); var size = Number(sourceSize);
if (isNaN(size)) {
return '';
}
return Filesize(size, { base: 2, round: 1 }); return Filesize(size, { base: 2, round: 1 });
}, },

Loading…
Cancel
Save