2013-06-25 05:12:42 +00:00
|
|
|
|
'use strict';
|
2013-06-24 23:41:59 +00:00
|
|
|
|
define(
|
|
|
|
|
[
|
|
|
|
|
'backbone',
|
|
|
|
|
'Series/SeriesModel',
|
|
|
|
|
'Series/EpisodeModel'
|
|
|
|
|
], function (Backbone, SeriesModel, EpisodeModel) {
|
|
|
|
|
return Backbone.Model.extend({
|
|
|
|
|
mutators: {
|
|
|
|
|
seasonNumber: function () {
|
|
|
|
|
return this.get('episode').seasonNumber;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
paddedEpisodeNumber: function () {
|
|
|
|
|
return this.get('episode').episodeNumber.pad(2);
|
|
|
|
|
}
|
2013-05-10 22:33:04 +00:00
|
|
|
|
},
|
2013-05-03 06:53:32 +00:00
|
|
|
|
|
2013-06-24 23:41:59 +00:00
|
|
|
|
parse: function (model) {
|
|
|
|
|
model.series = new SeriesModel(model.series);
|
|
|
|
|
model.episode = new EpisodeModel(model.episode);
|
2013-07-11 06:52:04 +00:00
|
|
|
|
model.episode.set('series', model.series);
|
2013-06-24 23:41:59 +00:00
|
|
|
|
return model;
|
2013-05-10 22:33:04 +00:00
|
|
|
|
}
|
2013-06-24 23:41:59 +00:00
|
|
|
|
});
|
2013-05-03 06:53:32 +00:00
|
|
|
|
});
|