1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/Series/SeriesModel.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

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