2013-06-25 04:51:17 +00:00
|
|
|
|
'use strict';
|
2013-06-24 23:41:59 +00:00
|
|
|
|
define(
|
|
|
|
|
[
|
|
|
|
|
'backbone',
|
2013-07-16 23:54:45 +00:00
|
|
|
|
|
2013-07-04 00:57:55 +00:00
|
|
|
|
'underscore'
|
2013-07-16 23:54:45 +00:00
|
|
|
|
], function (Backbone, _) {
|
2013-06-24 23:41:59 +00:00
|
|
|
|
return Backbone.Model.extend({
|
|
|
|
|
|
2013-06-25 05:12:42 +00:00
|
|
|
|
urlRoot: ApiRoot + '/series',
|
2013-06-24 23:41:59 +00:00
|
|
|
|
|
|
|
|
|
defaults: {
|
|
|
|
|
episodeFileCount: 0,
|
|
|
|
|
episodeCount : 0,
|
|
|
|
|
isExisting : false,
|
|
|
|
|
status : 0
|
2013-09-10 05:22:38 +00:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setSeasonMonitored: function (seasonNumber) {
|
|
|
|
|
_.each(this.get('seasons'), function (season) {
|
|
|
|
|
if (season.seasonNumber === seasonNumber) {
|
|
|
|
|
season.monitored = !season.monitored;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
setSeasonPass: function (seasonNumber) {
|
|
|
|
|
_.each(this.get('seasons'), function (season) {
|
|
|
|
|
if (season.seasonNumber >= seasonNumber) {
|
|
|
|
|
season.monitored = true;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
season.monitored = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
2013-02-14 02:28:56 +00:00
|
|
|
|
}
|
2013-06-24 23:41:59 +00:00
|
|
|
|
});
|
2013-02-14 02:28:56 +00:00
|
|
|
|
});
|