Added network support for updating all indexer settings, editing specific indexer settings, deleting an indexer; Also added keybindings for all of the above that change the current route. Added full support for deleting an indexer; still need to add an indexer_handler to handle the add, edit, and settings functionalities

This commit is contained in:
2023-08-08 10:50:07 -06:00
parent 52f22312f3
commit 2b9ddd0d1e
11 changed files with 419 additions and 58 deletions
+27
View File
@@ -251,6 +251,9 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
ActiveRadarrBlock::RootFolders => self
.app
.push_navigation_stack(ActiveRadarrBlock::DeleteRootFolderPrompt.into()),
ActiveRadarrBlock::Indexers => self
.app
.push_navigation_stack(ActiveRadarrBlock::DeleteIndexerPrompt.into()),
_ => (),
}
}
@@ -278,6 +281,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
_ => (),
},
ActiveRadarrBlock::DeleteDownloadPrompt
| ActiveRadarrBlock::DeleteIndexerPrompt
| ActiveRadarrBlock::DeleteRootFolderPrompt
| ActiveRadarrBlock::UpdateAllMoviesPrompt
| ActiveRadarrBlock::UpdateAllCollectionsPrompt
@@ -404,6 +408,13 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
self.app.pop_navigation_stack();
}
ActiveRadarrBlock::DeleteIndexerPrompt => {
if self.app.data.radarr_data.prompt_confirm {
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteIndexer);
}
self.app.pop_navigation_stack();
}
ActiveRadarrBlock::UpdateAllMoviesPrompt => {
if self.app.data.radarr_data.prompt_confirm {
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::UpdateAllMovies);
@@ -431,6 +442,11 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
self.app.should_ignore_quit_key = false;
self.app.pop_navigation_stack();
}
ActiveRadarrBlock::Indexers => {
self
.app
.push_navigation_stack(ActiveRadarrBlock::EditIndexer.into());
}
_ => (),
}
}
@@ -454,6 +470,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
self.app.should_ignore_quit_key = false;
}
ActiveRadarrBlock::DeleteDownloadPrompt
| ActiveRadarrBlock::DeleteIndexerPrompt
| ActiveRadarrBlock::DeleteRootFolderPrompt
| ActiveRadarrBlock::UpdateAllMoviesPrompt
| ActiveRadarrBlock::UpdateAllCollectionsPrompt
@@ -527,9 +544,19 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RadarrHandler<'a, 'b
_ => (),
},
ActiveRadarrBlock::Indexers => match self.key {
_ if *key == DEFAULT_KEYBINDINGS.add.key => {
self
.app
.push_navigation_stack(ActiveRadarrBlock::AddIndexer.into());
}
_ if *key == DEFAULT_KEYBINDINGS.refresh.key => {
self.app.should_refresh = true;
}
_ if *key == DEFAULT_KEYBINDINGS.settings.key => {
self
.app
.push_navigation_stack(ActiveRadarrBlock::IndexerSettings.into());
}
_ => (),
},
ActiveRadarrBlock::Collections => match self.key {