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

This commit is contained in:
Mark McDowall 2014-06-13 08:28:52 -07:00
parent fbdc84b6cd
commit 14f57d655a
2 changed files with 9 additions and 4 deletions

View File

@ -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;
} }

View File

@ -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 });
}, },