Lidarr/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-06-25 05:12:42 +00:00
urlRoot: 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;
}
});
}
});
});