Added size to episode downloaded tooltip

This commit is contained in:
Mark McDowall 2013-08-07 00:04:34 -07:00
parent 86fa34628f
commit 1d0f18e8f1
1 changed files with 11 additions and 5 deletions

View File

@ -3,8 +3,9 @@
define( define(
[ [
'backgrid', 'backgrid',
'moment' 'moment',
], function (Backgrid, Moment) { 'Shared/FormatHelpers'
], function (Backgrid, Moment, FormatHelpers) {
return Backgrid.Cell.extend({ return Backgrid.Cell.extend({
className: 'episode-status-cell', className: 'episode-status-cell',
@ -21,14 +22,19 @@ define(
var hasFile = this.model.get('hasFile'); var hasFile = this.model.get('hasFile');
if (hasFile) { if (hasFile) {
var quality = this.model.get('episodeFile').quality; var episodeFile = this.model.get('episodeFile');
var quality = episodeFile.quality;
var size = FormatHelpers.bytes(episodeFile.size);
var title = 'Episode downloaded';
if (quality.proper) { if (quality.proper) {
this.$el.html('<span class="badge badge-info" title="Episode downloaded [PROPER]">{0}</span>'.format(quality.quality.name)); title += ' [PROPER] - {0}'.format(size);
this.$el.html('<span class="badge badge-info" title="{0}">{1}</span>'.format(title, quality.quality.name));
} }
else { else {
this.$el.html('<span class="badge badge-inverse" title="Episode downloaded">{0}</span>'.format(quality.quality.name)); title += ' - {0}'.format(size);
this.$el.html('<span class="badge badge-inverse" title="{0}">{1}</span>'.format(title, quality.quality.name));
} }
return this; return this;