sonarr-repo-only/UI/Series/SeriesModel.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

2013-06-25 04:51:17 +00:00
'use strict';
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, _) {
return Backbone.Model.extend({
2013-09-14 07:10:19 +00:00
urlRoot: window.NzbDrone.ApiRoot + '/series',
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;
}
});
}
});
});