Fixed jslint errors

This commit is contained in:
Mark McDowall 2014-02-22 20:08:24 -08:00
parent 120a4cf9ec
commit ec88286d57
1 changed files with 10 additions and 19 deletions

View File

@ -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('<span class="badge badge-info" title="{0}">{1}</span>'.format(title, quality.quality.name));
}
else {
title += ' - {0}'.format(size);
this.$el.html('<span class="badge badge-inverse" title="{0}">{1}</span>'.format(title, quality.quality.name));
}
return;
}
else {
var model = this.model;
var downloading = QueueCollection.findEpisode(model.get('id'));