2013-06-22 09:24:24 +03:00
|
|
|
'use strict';
|
2013-06-09 23:51:32 +03:00
|
|
|
define(['app','Series/SeriesModel', 'Series/EpisodeModel'], function () {
|
2013-05-03 09:53:32 +03:00
|
|
|
NzbDrone.History.Model = Backbone.Model.extend({
|
2013-05-11 01:33:04 +03:00
|
|
|
mutators: {
|
|
|
|
seasonNumber: function () {
|
|
|
|
return this.get('episode').seasonNumber;
|
|
|
|
},
|
2013-05-03 09:53:32 +03:00
|
|
|
|
2013-05-11 01:33:04 +03:00
|
|
|
paddedEpisodeNumber: function () {
|
|
|
|
return this.get('episode').episodeNumber.pad(2);
|
|
|
|
}
|
2013-06-09 23:51:32 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
parse: function (model) {
|
|
|
|
model.series = new NzbDrone.Series.SeriesModel(model.series);
|
|
|
|
model.episode = new NzbDrone.Series.EpisodeModel(model.episode);
|
|
|
|
return model;
|
2013-05-11 01:33:04 +03:00
|
|
|
}
|
2013-06-09 23:51:32 +03:00
|
|
|
|
|
|
|
|
2013-05-03 09:53:32 +03:00
|
|
|
});
|
|
|
|
});
|