1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 11:25:26 +00:00

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

This commit is contained in:
Leonardo Galli 2017-06-12 14:10:07 +02:00
parent 43446ee3d0
commit edda8786ad
2 changed files with 14 additions and 3 deletions

View file

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

View file

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