2013-06-25 08:12:42 +03:00
|
|
|
'use strict';
|
2013-06-25 02:41:59 +03: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-11 01:33:04 +03:00
|
|
|
},
|
2013-05-03 09:53:32 +03:00
|
|
|
|
2013-06-25 02:41:59 +03:00
|
|
|
parse: function (model) {
|
|
|
|
model.series = new SeriesModel(model.series);
|
|
|
|
model.episode = new EpisodeModel(model.episode);
|
|
|
|
return model;
|
2013-05-11 01:33:04 +03:00
|
|
|
}
|
2013-06-25 02:41:59 +03:00
|
|
|
});
|
2013-05-03 09:53:32 +03:00
|
|
|
});
|