Added the ability to view Radarr updates and remapped the events queue key to 'z'
This commit is contained in:
@@ -23,6 +23,7 @@ generate_keybindings! {
|
||||
tasks,
|
||||
refresh,
|
||||
update,
|
||||
queue,
|
||||
home,
|
||||
end,
|
||||
delete,
|
||||
@@ -91,7 +92,11 @@ pub const DEFAULT_KEYBINDINGS: KeyBindings = KeyBindings {
|
||||
},
|
||||
update: KeyBinding {
|
||||
key: Key::Char('u'),
|
||||
desc: "Update All",
|
||||
desc: "Update",
|
||||
},
|
||||
queue: KeyBinding {
|
||||
key: Key::Char('z'),
|
||||
desc: "Queue",
|
||||
},
|
||||
home: KeyBinding {
|
||||
key: Key::Home,
|
||||
|
||||
+13
-4
@@ -54,6 +54,7 @@ pub struct RadarrData<'a> {
|
||||
pub log_details: StatefulList<HorizontallyScrollableText>,
|
||||
pub tasks: StatefulTable<Task>,
|
||||
pub queued_events: StatefulTable<QueueEvent>,
|
||||
pub updates: ScrollableText,
|
||||
pub prompt_confirm_action: Option<RadarrEvent>,
|
||||
pub main_tabs: TabState,
|
||||
pub movie_info_tabs: TabState,
|
||||
@@ -278,6 +279,7 @@ impl<'a> Default for RadarrData<'a> {
|
||||
log_details: StatefulList::default(),
|
||||
tasks: StatefulTable::default(),
|
||||
queued_events: StatefulTable::default(),
|
||||
updates: ScrollableText::default(),
|
||||
prompt_confirm_action: None,
|
||||
search: HorizontallyScrollableText::default(),
|
||||
filter: HorizontallyScrollableText::default(),
|
||||
@@ -320,7 +322,7 @@ impl<'a> Default for RadarrData<'a> {
|
||||
title: "System",
|
||||
route: ActiveRadarrBlock::System.into(),
|
||||
help: "",
|
||||
contextual_help: Some("<t> open tasks | <u> open queue | <l> open logs | <r> refresh")
|
||||
contextual_help: Some("<t> open tasks | <z> open queue | <l> open logs | <u> open updates | <r> refresh")
|
||||
}
|
||||
]),
|
||||
movie_info_tabs: TabState::new(vec![
|
||||
@@ -418,9 +420,10 @@ pub enum ActiveRadarrBlock {
|
||||
RootFolders,
|
||||
System,
|
||||
SystemLogs,
|
||||
SystemQueue,
|
||||
SystemTasks,
|
||||
SystemTaskStartConfirmPrompt,
|
||||
SystemQueue,
|
||||
SystemUpdates,
|
||||
UpdateAndScanPrompt,
|
||||
UpdateAllCollectionsPrompt,
|
||||
UpdateAllMoviesPrompt,
|
||||
@@ -519,11 +522,12 @@ pub static DELETE_MOVIE_SELECTION_BLOCKS: [ActiveRadarrBlock; 3] = [
|
||||
ActiveRadarrBlock::DeleteMovieToggleAddListExclusion,
|
||||
ActiveRadarrBlock::DeleteMovieConfirmPrompt,
|
||||
];
|
||||
pub static SYSTEM_DETAILS_BLOCKS: [ActiveRadarrBlock; 4] = [
|
||||
pub static SYSTEM_DETAILS_BLOCKS: [ActiveRadarrBlock; 5] = [
|
||||
ActiveRadarrBlock::SystemLogs,
|
||||
ActiveRadarrBlock::SystemTasks,
|
||||
ActiveRadarrBlock::SystemQueue,
|
||||
ActiveRadarrBlock::SystemTasks,
|
||||
ActiveRadarrBlock::SystemTaskStartConfirmPrompt,
|
||||
ActiveRadarrBlock::SystemUpdates,
|
||||
];
|
||||
|
||||
impl From<ActiveRadarrBlock> for Route {
|
||||
@@ -580,6 +584,11 @@ impl<'a> App<'a> {
|
||||
.dispatch_network_event(RadarrEvent::GetLogs.into())
|
||||
.await;
|
||||
}
|
||||
ActiveRadarrBlock::SystemUpdates => {
|
||||
self
|
||||
.dispatch_network_event(RadarrEvent::GetUpdates.into())
|
||||
.await;
|
||||
}
|
||||
ActiveRadarrBlock::AddMovieSearchResults => {
|
||||
self
|
||||
.dispatch_network_event(RadarrEvent::SearchNewMovie.into())
|
||||
|
||||
+19
-1
@@ -291,6 +291,7 @@ mod tests {
|
||||
assert!(radarr_data.log_details.items.is_empty());
|
||||
assert!(radarr_data.tasks.items.is_empty());
|
||||
assert!(radarr_data.queued_events.items.is_empty());
|
||||
assert!(radarr_data.updates.get_text().is_empty());
|
||||
assert!(radarr_data.prompt_confirm_action.is_none());
|
||||
assert!(radarr_data.search.text.is_empty());
|
||||
assert!(radarr_data.filter.text.is_empty());
|
||||
@@ -355,7 +356,7 @@ mod tests {
|
||||
assert!(radarr_data.main_tabs.tabs[4].help.is_empty());
|
||||
assert_eq!(
|
||||
radarr_data.main_tabs.tabs[4].contextual_help,
|
||||
Some("<t> open tasks | <u> open queue | <l> open logs | <r> refresh")
|
||||
Some("<t> open tasks | <z> open queue | <l> open logs | <u> open updates | <r> refresh")
|
||||
);
|
||||
|
||||
assert_eq!(radarr_data.movie_info_tabs.tabs.len(), 6);
|
||||
@@ -708,6 +709,23 @@ mod tests {
|
||||
assert_eq!(app.tick_count, 0);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_dispatch_by_system_updates_block() {
|
||||
let (mut app, mut sync_network_rx) = construct_app_unit();
|
||||
|
||||
app
|
||||
.dispatch_by_radarr_block(&ActiveRadarrBlock::SystemUpdates)
|
||||
.await;
|
||||
|
||||
assert!(app.is_loading);
|
||||
assert_eq!(
|
||||
sync_network_rx.recv().await.unwrap(),
|
||||
RadarrEvent::GetUpdates.into()
|
||||
);
|
||||
assert!(!app.data.radarr_data.prompt_confirm);
|
||||
assert_eq!(app.tick_count, 0);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_dispatch_by_add_movie_search_results_block() {
|
||||
let (mut app, mut sync_network_rx) = construct_app_unit();
|
||||
|
||||
Reference in New Issue
Block a user