From 14f57d655a2915c932182cb65643ab5e4ebb593a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 13 Jun 2014 08:28:52 -0700 Subject: [PATCH] Fixed: Don't show an error if filesize cannot be formatted --- src/UI/Cells/EpisodeStatusCell.js | 8 ++++---- src/UI/Shared/FormatHelpers.js | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/UI/Cells/EpisodeStatusCell.js b/src/UI/Cells/EpisodeStatusCell.js index 167ac8671..c8cd57510 100644 --- a/src/UI/Cells/EpisodeStatusCell.js +++ b/src/UI/Cells/EpisodeStatusCell.js @@ -50,15 +50,15 @@ define( var title = 'Episode downloaded'; if (quality.proper) { - title += ' [PROPER] - {0}'.format(size); - this.$el.html('{1}'.format(title, quality.quality.name)); + title += ' [PROPER]'; } - else { + if (size !== '') { title += ' - {0}'.format(size); - this.$el.html('{1}'.format(title, quality.quality.name)); } + this.$el.html('{1}'.format(title, quality.quality.name)); + return; } diff --git a/src/UI/Shared/FormatHelpers.js b/src/UI/Shared/FormatHelpers.js index 51e93cf5a..aaf51b1e1 100644 --- a/src/UI/Shared/FormatHelpers.js +++ b/src/UI/Shared/FormatHelpers.js @@ -10,6 +10,11 @@ define( bytes: function (sourceSize) { var size = Number(sourceSize); + + if (isNaN(size)) { + return ''; + } + return Filesize(size, { base: 2, round: 1 }); },