Minimum availability is now working similarely to profile when adding a movie.

pull/1637/merge
Leonardo Galli 8 years ago
parent 43446ee3d0
commit edda8786ad

@ -23,8 +23,8 @@ var view = Marionette.ItemView.extend({
rootFolder : '.x-root-folder', rootFolder : '.x-root-folder',
seasonFolder : '.x-season-folder', seasonFolder : '.x-season-folder',
monitor : '.x-monitor', monitor : '.x-monitor',
minimumAvailability : '.x-minimumavailability', minimumAvailability : '.x-minimumavailability',
minimumAvailabilityTooltip : '.x-minimumavailability-tooltip', minimumAvailabilityTooltip : '.x-minimumavailability-tooltip',
monitorTooltip : '.x-monitor-tooltip', monitorTooltip : '.x-monitor-tooltip',
addButton : '.x-add', addButton : '.x-add',
addSearchButton : '.x-add-search', addSearchButton : '.x-add-search',
@ -38,6 +38,7 @@ var view = Marionette.ItemView.extend({
'change .x-profile' : '_profileChanged', 'change .x-profile' : '_profileChanged',
'change .x-root-folder' : '_rootFolderChanged', 'change .x-root-folder' : '_rootFolderChanged',
'change .x-season-folder' : '_seasonFolderChanged', 'change .x-season-folder' : '_seasonFolderChanged',
"change .x-minimumavailability" : "_minAvailabilityChanged",
'change .x-monitor' : '_monitorChanged' 'change .x-monitor' : '_monitorChanged'
}, },
@ -61,6 +62,7 @@ var view = Marionette.ItemView.extend({
var defaultProfile = Config.getValue(Config.Keys.DefaultProfileId); var defaultProfile = Config.getValue(Config.Keys.DefaultProfileId);
var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId); var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId);
var defaultMinAvailability = Config.getValue(Config.Keys.DefaultMinAvailability, "announced");
var useSeasonFolder = Config.getValueBoolean(Config.Keys.UseSeasonFolder, true); var useSeasonFolder = Config.getValueBoolean(Config.Keys.UseSeasonFolder, true);
var defaultMonitorEpisodes = Config.getValue(Config.Keys.MonitorEpisodes, 'all'); var defaultMonitorEpisodes = Config.getValue(Config.Keys.MonitorEpisodes, 'all');
@ -74,7 +76,7 @@ var view = Marionette.ItemView.extend({
this.ui.seasonFolder.prop('checked', useSeasonFolder); this.ui.seasonFolder.prop('checked', useSeasonFolder);
this.ui.monitor.val(defaultMonitorEpisodes); this.ui.monitor.val(defaultMonitorEpisodes);
this.ui.minimumAvailability.val("preDB"); this.ui.minimumAvailability.val(defaultMinAvailability);
//TODO: make this work via onRender, FM? //TODO: make this work via onRender, FM?
//works with onShow, but stops working after the first render //works with onShow, but stops working after the first render
@ -136,6 +138,10 @@ var view = Marionette.ItemView.extend({
else if (options.key === Config.Keys.MonitorEpisodes) { else if (options.key === Config.Keys.MonitorEpisodes) {
this.ui.monitor.val(options.value); this.ui.monitor.val(options.value);
} }
else if (options.key === Config.Keys.DefaultMinAvailability) {
this.ui.minimumAvailability.val(options.value);
}
}, },
_profileChanged : function() { _profileChanged : function() {
@ -161,6 +167,10 @@ var view = Marionette.ItemView.extend({
Config.setValue(Config.Keys.MonitorEpisodes, this.ui.monitor.val()); Config.setValue(Config.Keys.MonitorEpisodes, this.ui.monitor.val());
}, },
_minAvailabilityChanged : function() {
Config.setValue(Config.Keys.DefaultMinAvailability, this.ui.minimumAvailability.val());
},
_setRootFolder : function(options) { _setRootFolder : function(options) {
vent.trigger(vent.Commands.CloseModalCommand); vent.trigger(vent.Commands.CloseModalCommand);
this.ui.rootFolder.val(options.model.id); this.ui.rootFolder.val(options.model.id);

@ -11,6 +11,7 @@ module.exports = {
Keys : { Keys : {
DefaultProfileId : 'RadarrDefaultProfileId', DefaultProfileId : 'RadarrDefaultProfileId',
DefaultRootFolderId : 'RadarrDefaultRootFolderId', DefaultRootFolderId : 'RadarrDefaultRootFolderId',
DefaultMinAvailability : "RadarrDefaultMinAvailability",
UseSeasonFolder : 'RadarrUseSeasonFolder', UseSeasonFolder : 'RadarrUseSeasonFolder',
DefaultSeriesType : 'RadarrDefaultSeriesType', DefaultSeriesType : 'RadarrDefaultSeriesType',
MonitorEpisodes : 'RadarrMonitorEpisodes', MonitorEpisodes : 'RadarrMonitorEpisodes',

Loading…
Cancel
Save