mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-15 21:06:20 -04:00
Indexers are saved when settings are saved
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<button class="btn btn-success x-add">Add</button>
|
||||
<button class="btn btn-success x-add">Add Newznab</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -35,17 +35,21 @@ define(['app',
|
||||
},
|
||||
|
||||
saveSettings: function () {
|
||||
//TODO: check if any models in the collection have changed and sync them only
|
||||
// this.collection.sync();
|
||||
// if (!this.model.isSaved) {
|
||||
// this.model.save(undefined, this.syncNotification("Naming Settings Saved", "Couldn't Save Naming Settings"));
|
||||
// }
|
||||
var self = this;
|
||||
|
||||
//For now loop through and save all the models
|
||||
|
||||
_.each(this.collection.models, function (model, index, list) {
|
||||
var name = model.get('name');
|
||||
var error = 'Failed to save indexer: ' + name;
|
||||
|
||||
model.save(undefined, self.syncNotification(error));
|
||||
});
|
||||
},
|
||||
|
||||
syncNotification: function (success, error) {
|
||||
syncNotification: function (error) {
|
||||
return {
|
||||
success: function () {
|
||||
NzbDrone.Shared.Messenger.show({message: 'General Settings Saved'});
|
||||
},
|
||||
error : function () {
|
||||
NzbDrone.Shared.Messenger.show({message: "Couldn't Save General Settings", type: 'error'});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{#if id}}
|
||||
<h3>Edit</h3>
|
||||
{{else}}
|
||||
<h3>Add</h3>
|
||||
<h3>Add Newznab</h3>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
Reference in New Issue
Block a user