Using reqres to map episode to episode file

This commit is contained in:
Mark McDowall 2013-08-21 17:56:25 -07:00
parent 8737cb0145
commit b1899b5f6f
8 changed files with 73 additions and 16 deletions

View file

@ -2,10 +2,11 @@
define(
[
'app',
'Cells/NzbDroneCell',
'moment',
'Shared/FormatHelpers'
], function (NzbDroneCell, Moment, FormatHelpers) {
], function (App, NzbDroneCell, Moment, FormatHelpers) {
return NzbDroneCell.extend({
className: 'episode-status-cell',
@ -22,7 +23,10 @@ define(
var hasFile = this.model.get('hasFile');
if (hasFile) {
var episodeFile = this.model.get('episodeFile');
var episodeFile = App.request(App.Reqres.GetEpisodeFileById, this.model.get('episodeFileId'));
this.listenTo(episodeFile, 'change', this._refresh);
var quality = episodeFile.get('quality');
var size = FormatHelpers.bytes(episodeFile.get('size'));
var title = 'Episode downloaded';