From ec88286d57553e8e711d9280f2714a671dcb23f1 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 22 Feb 2014 20:08:24 -0800 Subject: [PATCH] Fixed jslint errors --- src/UI/Cells/EpisodeStatusCell.js | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/UI/Cells/EpisodeStatusCell.js b/src/UI/Cells/EpisodeStatusCell.js index f54f2c474..9d6c29567 100644 --- a/src/UI/Cells/EpisodeStatusCell.js +++ b/src/UI/Cells/EpisodeStatusCell.js @@ -31,8 +31,16 @@ define( var hasAired = Moment(this.model.get('airDateUtc')).isBefore(Moment()); var hasFile = this.model.get('hasFile'); - if (hasFile && reqres.hasHandler(reqres.Requests.GetEpisodeFileById)) { - var episodeFile = reqres.request(reqres.Requests.GetEpisodeFileById, this.model.get('episodeFileId')); + if (hasFile) { + var episodeFile; + + if (reqres.hasHandler(reqres.Requests.GetEpisodeFileById)) { + episodeFile = reqres.request(reqres.Requests.GetEpisodeFileById, this.model.get('episodeFileId')); + } + + else { + episodeFile = this.model.get('episodeFile'); + } this.listenTo(episodeFile, 'change', this._refresh); @@ -52,24 +60,7 @@ define( return; } - else if (hasFile && this.model.get('episodeFile')) { - var episodeFile = this.model.get('episodeFile'); - - var quality = episodeFile.quality; - var size = FormatHelpers.bytes(episodeFile.size); - var title = 'Episode downloaded'; - if (quality.proper) { - title += ' [PROPER] - {0}'.format(size); - this.$el.html('{1}'.format(title, quality.quality.name)); - } - else { - title += ' - {0}'.format(size); - this.$el.html('{1}'.format(title, quality.quality.name)); - } - - return; - } else { var model = this.model; var downloading = QueueCollection.findEpisode(model.get('id'));