2013-06-25 07:51:17 +03:00
|
|
|
'use strict';
|
2013-06-25 02:41:59 +03:00
|
|
|
define(
|
|
|
|
[
|
|
|
|
'backbone',
|
2013-07-17 02:54:45 +03:00
|
|
|
|
2013-07-04 03:57:55 +03:00
|
|
|
'underscore'
|
2013-07-17 02:54:45 +03:00
|
|
|
], function (Backbone, _) {
|
2013-06-25 02:41:59 +03:00
|
|
|
return Backbone.Model.extend({
|
|
|
|
|
2013-09-14 10:10:19 +03:00
|
|
|
urlRoot: window.NzbDrone.ApiRoot + '/series',
|
2013-06-25 02:41:59 +03:00
|
|
|
|
|
|
|
defaults: {
|
|
|
|
episodeFileCount: 0,
|
|
|
|
episodeCount : 0,
|
|
|
|
isExisting : false,
|
|
|
|
status : 0
|
2013-09-10 08:22:38 +03: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 05:28:56 +03:00
|
|
|
}
|
2013-06-25 02:41:59 +03:00
|
|
|
});
|
2013-02-14 05:28:56 +03:00
|
|
|
});
|