Refactored handlers and UI to have a separate radarr module, and implemented movie search functionality for existing movies.

This commit is contained in:
2023-08-08 10:50:04 -06:00
parent 3f378fb25a
commit a304367e0e
14 changed files with 1263 additions and 929 deletions
+15 -5
View File
@@ -9,12 +9,14 @@ macro_rules! generate_keybindings {
}
generate_keybindings! {
quit,
up,
down,
left,
right,
backspace,
search,
submit,
quit,
esc
}
@@ -24,10 +26,6 @@ pub struct KeyBinding {
}
pub const DEFAULT_KEYBINDINGS: KeyBindings = KeyBindings {
quit: KeyBinding {
key: Key::Char('q'),
desc: "Quit",
},
up: KeyBinding {
key: Key::Up,
desc: "Scroll up",
@@ -44,10 +42,22 @@ pub const DEFAULT_KEYBINDINGS: KeyBindings = KeyBindings {
key: Key::Right,
desc: "Move right",
},
backspace: KeyBinding {
key: Key::Backspace,
desc: "Backspace",
},
search: KeyBinding {
key: Key::Char('s'),
desc: "Search",
},
submit: KeyBinding {
key: Key::Enter,
desc: "Select",
},
quit: KeyBinding {
key: Key::Char('q'),
desc: "Quit",
},
esc: KeyBinding {
key: Key::Esc,
desc: "Exit current menu",
+6 -1
View File
@@ -29,6 +29,8 @@ pub struct RadarrData {
pub collection_movies: StatefulTable<CollectionMovie>,
pub main_tabs: TabState,
pub movie_info_tabs: TabState,
pub search: String,
pub is_searching: bool,
}
impl RadarrData {
@@ -70,11 +72,14 @@ impl Default for RadarrData {
movie_crew: StatefulTable::default(),
collections: StatefulTable::default(),
collection_movies: StatefulTable::default(),
search: String::default(),
is_searching: false,
main_tabs: TabState::new(vec![
TabRoute {
title: "Library".to_owned(),
route: ActiveRadarrBlock::Movies.into(),
help: "<↑↓> scroll table | <enter> movie details | ←→ change tab ".to_owned(),
help: "<↑↓> scroll table | <s> search | <enter> movie details | ←→ change tab "
.to_owned(),
},
TabRoute {
title: "Downloads".to_owned(),