Added the full Radarr CLI so users can programmatically access all the same management features as in the TUI
This commit is contained in:
@@ -410,7 +410,7 @@ mod tests {
|
||||
#[case(
|
||||
ActiveRadarrBlock::Blocklist,
|
||||
ActiveRadarrBlock::DeleteBlocklistItemPrompt,
|
||||
RadarrEvent::DeleteBlocklistItem
|
||||
RadarrEvent::DeleteBlocklistItem(None)
|
||||
)]
|
||||
#[case(
|
||||
ActiveRadarrBlock::Blocklist,
|
||||
|
||||
@@ -132,7 +132,8 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for BlocklistHandler<'a,
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::DeleteBlocklistItemPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteBlocklistItem);
|
||||
self.app.data.radarr_data.prompt_confirm_action =
|
||||
Some(RadarrEvent::DeleteBlocklistItem(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use core::sync::atomic::Ordering::SeqCst;
|
||||
use std::cmp::Ordering;
|
||||
use std::iter;
|
||||
|
||||
@@ -231,7 +232,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
@@ -239,7 +240,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -252,7 +253,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
@@ -260,7 +261,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -284,7 +285,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
@@ -292,7 +293,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -305,7 +306,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
@@ -313,7 +314,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -458,7 +459,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
@@ -466,7 +467,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -479,7 +480,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
@@ -487,7 +488,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -506,7 +507,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
@@ -514,7 +515,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -527,7 +528,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.collections
|
||||
@@ -535,7 +536,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,8 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for EditCollectionHandle
|
||||
match self.app.data.radarr_data.selected_block.get_active_block() {
|
||||
ActiveRadarrBlock::EditCollectionConfirmPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::EditCollection);
|
||||
self.app.data.radarr_data.prompt_confirm_action =
|
||||
Some(RadarrEvent::EditCollection(None));
|
||||
self.app.should_refresh = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -200,6 +200,8 @@ mod tests {
|
||||
}
|
||||
|
||||
mod test_handle_home_end {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use pretty_assertions::assert_eq;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
@@ -337,7 +339,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_collection_modal
|
||||
@@ -345,7 +347,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -358,7 +360,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_collection_modal
|
||||
@@ -366,13 +368,15 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_left_right_action {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use crate::models::servarr_data::radarr::modals::EditCollectionModal;
|
||||
use rstest::rstest;
|
||||
|
||||
@@ -420,7 +424,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_collection_modal
|
||||
@@ -428,7 +432,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -441,7 +445,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_collection_modal
|
||||
@@ -449,7 +453,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -561,7 +565,7 @@ mod tests {
|
||||
);
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::EditCollection)
|
||||
Some(RadarrEvent::EditCollection(None))
|
||||
);
|
||||
assert!(app.should_refresh);
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ mod tests {
|
||||
#[case(
|
||||
ActiveRadarrBlock::Downloads,
|
||||
ActiveRadarrBlock::DeleteDownloadPrompt,
|
||||
RadarrEvent::DeleteDownload
|
||||
RadarrEvent::DeleteDownload(None)
|
||||
)]
|
||||
#[case(
|
||||
ActiveRadarrBlock::Downloads,
|
||||
|
||||
@@ -91,7 +91,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for DownloadsHandler<'a,
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::DeleteDownloadPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteDownload);
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteDownload(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
|
||||
@@ -275,7 +275,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for EditIndexerHandler<'
|
||||
ActiveRadarrBlock::EditIndexerConfirmPrompt => {
|
||||
let radarr_data = &mut self.app.data.radarr_data;
|
||||
if radarr_data.prompt_confirm {
|
||||
radarr_data.prompt_confirm_action = Some(RadarrEvent::EditIndexer);
|
||||
radarr_data.prompt_confirm_action = Some(RadarrEvent::EditIndexer(None));
|
||||
self.app.should_refresh = true;
|
||||
} else {
|
||||
radarr_data.edit_indexer_modal = None;
|
||||
|
||||
@@ -66,6 +66,8 @@ mod tests {
|
||||
}
|
||||
|
||||
mod test_handle_home_end {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::servarr_data::radarr::modals::EditIndexerModal;
|
||||
use pretty_assertions::assert_eq;
|
||||
@@ -89,7 +91,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -97,7 +99,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.name
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -110,7 +112,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -118,7 +120,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.name
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -140,7 +142,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -148,7 +150,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.url
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -161,7 +163,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -169,7 +171,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.url
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -191,7 +193,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -199,7 +201,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.api_key
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -212,7 +214,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -220,7 +222,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.api_key
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -242,7 +244,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -250,7 +252,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.seed_ratio
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -263,7 +265,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -271,7 +273,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.seed_ratio
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -293,7 +295,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -301,7 +303,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -314,7 +316,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -322,13 +324,15 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_left_right_action {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::servarr_data::radarr::modals::EditIndexerModal;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
@@ -511,7 +515,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -519,7 +523,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.name
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -532,7 +536,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -540,7 +544,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.name
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -562,7 +566,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -570,7 +574,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.url
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -583,7 +587,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -591,7 +595,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.url
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -613,7 +617,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -621,7 +625,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.api_key
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -634,7 +638,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -642,7 +646,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.api_key
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -664,7 +668,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -672,7 +676,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.seed_ratio
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -685,7 +689,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -693,7 +697,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.seed_ratio
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -715,7 +719,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -723,7 +727,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -736,7 +740,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_indexer_modal
|
||||
@@ -744,7 +748,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -821,7 +825,7 @@ mod tests {
|
||||
assert!(app.should_refresh);
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::EditIndexer)
|
||||
Some(RadarrEvent::EditIndexer(None))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexerSettingsHandl
|
||||
fn handle_scroll_up(&mut self) {
|
||||
let indexer_settings = self.app.data.radarr_data.indexer_settings.as_mut().unwrap();
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::IndexerSettingsPrompt => {
|
||||
ActiveRadarrBlock::AllIndexerSettingsPrompt => {
|
||||
self.app.data.radarr_data.selected_block.previous();
|
||||
}
|
||||
ActiveRadarrBlock::IndexerSettingsMinimumAgeInput => {
|
||||
@@ -74,7 +74,9 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexerSettingsHandl
|
||||
fn handle_scroll_down(&mut self) {
|
||||
let indexer_settings = self.app.data.radarr_data.indexer_settings.as_mut().unwrap();
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::IndexerSettingsPrompt => self.app.data.radarr_data.selected_block.next(),
|
||||
ActiveRadarrBlock::AllIndexerSettingsPrompt => {
|
||||
self.app.data.radarr_data.selected_block.next()
|
||||
}
|
||||
ActiveRadarrBlock::IndexerSettingsMinimumAgeInput => {
|
||||
if indexer_settings.minimum_age > 0 {
|
||||
indexer_settings.minimum_age -= 1;
|
||||
@@ -134,7 +136,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexerSettingsHandl
|
||||
|
||||
fn handle_left_right_action(&mut self) {
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::IndexerSettingsPrompt => {
|
||||
ActiveRadarrBlock::AllIndexerSettingsPrompt => {
|
||||
if self.app.data.radarr_data.selected_block.get_active_block()
|
||||
== &ActiveRadarrBlock::IndexerSettingsConfirmPrompt
|
||||
{
|
||||
@@ -165,12 +167,12 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexerSettingsHandl
|
||||
|
||||
fn handle_submit(&mut self) {
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::IndexerSettingsPrompt => {
|
||||
ActiveRadarrBlock::AllIndexerSettingsPrompt => {
|
||||
match self.app.data.radarr_data.selected_block.get_active_block() {
|
||||
ActiveRadarrBlock::IndexerSettingsConfirmPrompt => {
|
||||
let radarr_data = &mut self.app.data.radarr_data;
|
||||
if radarr_data.prompt_confirm {
|
||||
radarr_data.prompt_confirm_action = Some(RadarrEvent::EditAllIndexerSettings);
|
||||
radarr_data.prompt_confirm_action = Some(RadarrEvent::EditAllIndexerSettings(None));
|
||||
self.app.should_refresh = true;
|
||||
} else {
|
||||
radarr_data.indexer_settings = None;
|
||||
@@ -225,7 +227,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexerSettingsHandl
|
||||
|
||||
fn handle_esc(&mut self) {
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::IndexerSettingsPrompt => {
|
||||
ActiveRadarrBlock::AllIndexerSettingsPrompt => {
|
||||
self.app.pop_navigation_stack();
|
||||
self.app.data.radarr_data.prompt_confirm = false;
|
||||
self.app.data.radarr_data.indexer_settings = None;
|
||||
|
||||
@@ -104,7 +104,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -136,7 +136,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -201,6 +201,8 @@ mod tests {
|
||||
}
|
||||
|
||||
mod test_handle_home_end {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
use crate::models::radarr_models::IndexerSettings;
|
||||
@@ -224,7 +226,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.indexer_settings
|
||||
@@ -232,7 +234,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.whitelisted_hardcoded_subs
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -245,7 +247,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.indexer_settings
|
||||
@@ -253,13 +255,15 @@ mod tests {
|
||||
.unwrap()
|
||||
.whitelisted_hardcoded_subs
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_left_right_action {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use crate::models::radarr_models::IndexerSettings;
|
||||
use crate::models::servarr_data::radarr::radarr_data::INDEXER_SETTINGS_SELECTION_BLOCKS;
|
||||
use crate::models::BlockSelectionState;
|
||||
@@ -278,7 +282,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -288,7 +292,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -336,7 +340,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -349,7 +353,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -377,7 +381,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.indexer_settings
|
||||
@@ -385,7 +389,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.whitelisted_hardcoded_subs
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -398,7 +402,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.indexer_settings
|
||||
@@ -406,7 +410,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.whitelisted_hardcoded_subs
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -432,7 +436,7 @@ mod tests {
|
||||
fn test_edit_indexer_settings_prompt_prompt_decline_submit() {
|
||||
let mut app = App::default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(&INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
app
|
||||
@@ -445,7 +449,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -460,7 +464,7 @@ mod tests {
|
||||
fn test_edit_indexer_settings_prompt_prompt_confirmation_submit() {
|
||||
let mut app = App::default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(&INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
app
|
||||
@@ -474,7 +478,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -482,7 +486,7 @@ mod tests {
|
||||
assert_eq!(app.get_current_route(), &ActiveRadarrBlock::Indexers.into());
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::EditAllIndexerSettings)
|
||||
Some(RadarrEvent::EditAllIndexerSettings(None))
|
||||
);
|
||||
assert!(app.data.radarr_data.indexer_settings.is_some());
|
||||
assert!(app.should_refresh);
|
||||
@@ -493,21 +497,21 @@ mod tests {
|
||||
let mut app = App::default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.radarr_data.indexer_settings = Some(IndexerSettings::default());
|
||||
app.data.radarr_data.prompt_confirm = true;
|
||||
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
assert!(!app.should_refresh);
|
||||
}
|
||||
@@ -524,7 +528,7 @@ mod tests {
|
||||
) {
|
||||
let mut app = App::default();
|
||||
app.data.radarr_data.indexer_settings = Some(IndexerSettings::default());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(&INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.selected_block.set_index(index);
|
||||
@@ -532,7 +536,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -547,7 +551,7 @@ mod tests {
|
||||
let mut app = App::default();
|
||||
app.is_loading = true;
|
||||
app.data.radarr_data.indexer_settings = Some(IndexerSettings::default());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(&INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.selected_block.set_index(index);
|
||||
@@ -555,14 +559,14 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -570,7 +574,7 @@ mod tests {
|
||||
fn test_edit_indexer_settings_prompt_submit_whitelisted_subtitle_tags_input() {
|
||||
let mut app = App::default();
|
||||
app.data.radarr_data.indexer_settings = Some(IndexerSettings::default());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(&INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.selected_block.set_index(7);
|
||||
@@ -578,7 +582,7 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -597,19 +601,19 @@ mod tests {
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(&INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.selected_block.set_index(3);
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
assert!(
|
||||
app
|
||||
@@ -624,14 +628,14 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
assert!(
|
||||
!app
|
||||
@@ -651,19 +655,19 @@ mod tests {
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(&INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.selected_block.set_index(8);
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
assert!(
|
||||
app
|
||||
@@ -678,14 +682,14 @@ mod tests {
|
||||
IndexerSettingsHandler::with(
|
||||
&SUBMIT_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
assert!(
|
||||
!app
|
||||
@@ -706,7 +710,7 @@ mod tests {
|
||||
whitelisted_hardcoded_subs: "Test tags".into(),
|
||||
..IndexerSettings::default()
|
||||
});
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(
|
||||
ActiveRadarrBlock::IndexerSettingsWhitelistedSubtitleTagsInput.into(),
|
||||
);
|
||||
@@ -731,7 +735,7 @@ mod tests {
|
||||
.is_empty());
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -748,14 +752,14 @@ mod tests {
|
||||
) {
|
||||
let mut app = App::default();
|
||||
app.data.radarr_data.indexer_settings = Some(IndexerSettings::default());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
|
||||
IndexerSettingsHandler::with(&SUBMIT_KEY, &mut app, &active_radarr_block, &None).handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -775,13 +779,13 @@ mod tests {
|
||||
let mut app = App::default();
|
||||
app.is_loading = is_ready;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.radarr_data.indexer_settings = Some(IndexerSettings::default());
|
||||
|
||||
IndexerSettingsHandler::with(
|
||||
&ESC_KEY,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
)
|
||||
.handle();
|
||||
@@ -926,7 +930,7 @@ mod tests {
|
||||
let handler = IndexerSettingsHandler::with(
|
||||
&DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
);
|
||||
|
||||
@@ -941,7 +945,7 @@ mod tests {
|
||||
let handler = IndexerSettingsHandler::with(
|
||||
&DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
);
|
||||
|
||||
@@ -957,7 +961,7 @@ mod tests {
|
||||
let handler = IndexerSettingsHandler::with(
|
||||
&DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
&None,
|
||||
);
|
||||
|
||||
|
||||
@@ -375,7 +375,7 @@ mod tests {
|
||||
assert!(app.data.radarr_data.prompt_confirm);
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::DeleteIndexer)
|
||||
Some(RadarrEvent::DeleteIndexer(None))
|
||||
);
|
||||
assert_eq!(app.get_current_route(), &ActiveRadarrBlock::Indexers.into());
|
||||
}
|
||||
@@ -577,7 +577,7 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
&ActiveRadarrBlock::IndexerSettingsPrompt.into()
|
||||
&ActiveRadarrBlock::AllIndexerSettingsPrompt.into()
|
||||
);
|
||||
assert_eq!(
|
||||
app.data.radarr_data.selected_block.blocks,
|
||||
@@ -724,7 +724,7 @@ mod tests {
|
||||
#[rstest]
|
||||
fn test_delegates_indexer_settings_blocks_to_indexer_settings_handler(
|
||||
#[values(
|
||||
ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
ActiveRadarrBlock::IndexerSettingsAvailabilityDelayInput,
|
||||
ActiveRadarrBlock::IndexerSettingsConfirmPrompt,
|
||||
ActiveRadarrBlock::IndexerSettingsMaximumSizeInput,
|
||||
|
||||
@@ -121,7 +121,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexersHandler<'a,
|
||||
ActiveRadarrBlock::DeleteIndexerPrompt => {
|
||||
let radarr_data = &mut self.app.data.radarr_data;
|
||||
if radarr_data.prompt_confirm {
|
||||
radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteIndexer);
|
||||
radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteIndexer(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
@@ -189,7 +189,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for IndexersHandler<'a,
|
||||
_ if *key == DEFAULT_KEYBINDINGS.settings.key => {
|
||||
self
|
||||
.app
|
||||
.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsPrompt.into());
|
||||
.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
self.app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(&INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for AddMovieHandler<'a,
|
||||
match self.app.data.radarr_data.selected_block.get_active_block() {
|
||||
ActiveRadarrBlock::AddMovieConfirmPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::AddMovie);
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::AddMovie(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
|
||||
@@ -416,6 +416,8 @@ mod tests {
|
||||
}
|
||||
|
||||
mod test_handle_home_end {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::extended_stateful_iterable_vec;
|
||||
@@ -769,14 +771,14 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.add_movie_search
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -789,14 +791,14 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.add_movie_search
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -818,7 +820,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.add_movie_modal
|
||||
@@ -826,7 +828,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -839,7 +841,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.add_movie_modal
|
||||
@@ -847,13 +849,15 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_left_right_action {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use crate::models::servarr_data::radarr::modals::AddMovieModal;
|
||||
use rstest::rstest;
|
||||
|
||||
@@ -886,14 +890,14 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.add_movie_search
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -906,14 +910,14 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.add_movie_search
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -935,7 +939,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.add_movie_modal
|
||||
@@ -943,7 +947,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -956,7 +960,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.add_movie_modal
|
||||
@@ -964,7 +968,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -1211,7 +1215,7 @@ mod tests {
|
||||
assert_eq!(app.get_current_route(), &ActiveRadarrBlock::Movies.into());
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::AddMovie)
|
||||
Some(RadarrEvent::AddMovie(None))
|
||||
);
|
||||
assert!(app.data.radarr_data.add_movie_modal.is_some());
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for DeleteMovieHandler<'
|
||||
match self.app.data.radarr_data.selected_block.get_active_block() {
|
||||
ActiveRadarrBlock::DeleteMovieConfirmPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteMovie);
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteMovie(None));
|
||||
self.app.should_refresh = true;
|
||||
} else {
|
||||
self.app.data.radarr_data.reset_delete_movie_preferences();
|
||||
|
||||
@@ -150,7 +150,7 @@ mod tests {
|
||||
assert_eq!(app.get_current_route(), &ActiveRadarrBlock::Movies.into());
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::DeleteMovie)
|
||||
Some(RadarrEvent::DeleteMovie(None))
|
||||
);
|
||||
assert!(app.should_refresh);
|
||||
assert!(app.data.radarr_data.prompt_confirm);
|
||||
|
||||
@@ -222,7 +222,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for EditMovieHandler<'a,
|
||||
match self.app.data.radarr_data.selected_block.get_active_block() {
|
||||
ActiveRadarrBlock::EditMovieConfirmPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::EditMovie);
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::EditMovie(None));
|
||||
self.app.should_refresh = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +182,8 @@ mod tests {
|
||||
}
|
||||
|
||||
mod test_handle_home_end {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::models::servarr_data::radarr::modals::EditMovieModal;
|
||||
@@ -318,7 +320,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_movie_modal
|
||||
@@ -326,7 +328,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -339,7 +341,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_movie_modal
|
||||
@@ -347,7 +349,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -369,7 +371,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_movie_modal
|
||||
@@ -377,7 +379,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -390,7 +392,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_movie_modal
|
||||
@@ -398,13 +400,15 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_left_right_action {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use crate::models::servarr_data::radarr::modals::EditMovieModal;
|
||||
use rstest::rstest;
|
||||
|
||||
@@ -440,7 +444,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_movie_modal
|
||||
@@ -448,7 +452,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -461,7 +465,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_movie_modal
|
||||
@@ -469,7 +473,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.path
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -491,7 +495,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_movie_modal
|
||||
@@ -499,7 +503,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -512,7 +516,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_movie_modal
|
||||
@@ -520,7 +524,7 @@ mod tests {
|
||||
.unwrap()
|
||||
.tags
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -661,7 +665,7 @@ mod tests {
|
||||
assert_eq!(app.get_current_route(), &ActiveRadarrBlock::Movies.into());
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::EditMovie)
|
||||
Some(RadarrEvent::EditMovie(None))
|
||||
);
|
||||
assert!(app.data.radarr_data.edit_movie_modal.is_some());
|
||||
assert!(app.should_refresh);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use core::sync::atomic::Ordering::SeqCst;
|
||||
use pretty_assertions::{assert_eq, assert_str_eq};
|
||||
use rstest::rstest;
|
||||
use std::cmp::Ordering;
|
||||
@@ -213,7 +214,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
@@ -221,7 +222,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -234,7 +235,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
@@ -242,7 +243,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -266,7 +267,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
@@ -274,7 +275,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -287,7 +288,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
@@ -295,7 +296,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -488,7 +489,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
@@ -496,7 +497,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -509,7 +510,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
@@ -517,7 +518,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -536,7 +537,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
@@ -544,7 +545,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -557,7 +558,7 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movies
|
||||
@@ -565,7 +566,7 @@ mod tests {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
@@ -349,14 +349,14 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for MovieDetailsHandler<
|
||||
ActiveRadarrBlock::AutomaticallySearchMoviePrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action =
|
||||
Some(RadarrEvent::TriggerAutomaticSearch);
|
||||
Some(RadarrEvent::TriggerAutomaticSearch(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
}
|
||||
ActiveRadarrBlock::UpdateAndScanPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::UpdateAndScan);
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::UpdateAndScan(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
@@ -368,7 +368,8 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for MovieDetailsHandler<
|
||||
}
|
||||
ActiveRadarrBlock::ManualSearchConfirmPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::DownloadRelease);
|
||||
self.app.data.radarr_data.prompt_confirm_action =
|
||||
Some(RadarrEvent::DownloadRelease(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
|
||||
@@ -1292,12 +1292,15 @@ mod tests {
|
||||
#[rstest]
|
||||
#[case(
|
||||
ActiveRadarrBlock::AutomaticallySearchMoviePrompt,
|
||||
RadarrEvent::TriggerAutomaticSearch
|
||||
RadarrEvent::TriggerAutomaticSearch(None)
|
||||
)]
|
||||
#[case(
|
||||
ActiveRadarrBlock::UpdateAndScanPrompt,
|
||||
RadarrEvent::UpdateAndScan(None)
|
||||
)]
|
||||
#[case(ActiveRadarrBlock::UpdateAndScanPrompt, RadarrEvent::UpdateAndScan)]
|
||||
#[case(
|
||||
ActiveRadarrBlock::ManualSearchConfirmPrompt,
|
||||
RadarrEvent::DownloadRelease
|
||||
RadarrEvent::DownloadRelease(None)
|
||||
)]
|
||||
fn test_movie_info_prompt_confirm_submit(
|
||||
#[case] prompt_block: ActiveRadarrBlock,
|
||||
|
||||
@@ -140,7 +140,7 @@ mod tests {
|
||||
#[values(
|
||||
ActiveRadarrBlock::DeleteIndexerPrompt,
|
||||
ActiveRadarrBlock::Indexers,
|
||||
ActiveRadarrBlock::IndexerSettingsPrompt,
|
||||
ActiveRadarrBlock::AllIndexerSettingsPrompt,
|
||||
ActiveRadarrBlock::IndexerSettingsAvailabilityDelayInput,
|
||||
ActiveRadarrBlock::IndexerSettingsConfirmPrompt,
|
||||
ActiveRadarrBlock::IndexerSettingsMaximumSizeInput,
|
||||
|
||||
@@ -115,7 +115,8 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RootFoldersHandler<'
|
||||
match self.active_radarr_block {
|
||||
ActiveRadarrBlock::DeleteRootFolderPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::DeleteRootFolder);
|
||||
self.app.data.radarr_data.prompt_confirm_action =
|
||||
Some(RadarrEvent::DeleteRootFolder(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
@@ -131,7 +132,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for RootFoldersHandler<'
|
||||
.text
|
||||
.is_empty() =>
|
||||
{
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::AddRootFolder);
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::AddRootFolder(None));
|
||||
self.app.data.radarr_data.prompt_confirm = true;
|
||||
self.app.should_ignore_quit_key = false;
|
||||
self.app.pop_navigation_stack();
|
||||
|
||||
@@ -59,6 +59,8 @@ mod tests {
|
||||
}
|
||||
|
||||
mod test_handle_home_end {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
use crate::models::radarr_models::RootFolder;
|
||||
@@ -132,14 +134,14 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_root_folder
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
4
|
||||
);
|
||||
|
||||
@@ -152,14 +154,14 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_root_folder
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -222,6 +224,8 @@ mod tests {
|
||||
}
|
||||
|
||||
mod test_handle_left_right_action {
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use pretty_assertions::assert_eq;
|
||||
use rstest::rstest;
|
||||
|
||||
@@ -313,14 +317,14 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_root_folder
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
1
|
||||
);
|
||||
|
||||
@@ -333,14 +337,14 @@ mod tests {
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
*app
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.edit_root_folder
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.offset
|
||||
.borrow(),
|
||||
.load(Ordering::SeqCst),
|
||||
0
|
||||
);
|
||||
}
|
||||
@@ -381,7 +385,7 @@ mod tests {
|
||||
assert!(!app.should_ignore_quit_key);
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::AddRootFolder)
|
||||
Some(RadarrEvent::AddRootFolder(None))
|
||||
);
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
@@ -438,7 +442,7 @@ mod tests {
|
||||
assert!(app.data.radarr_data.prompt_confirm);
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::DeleteRootFolder)
|
||||
Some(RadarrEvent::DeleteRootFolder(None))
|
||||
);
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
|
||||
@@ -136,7 +136,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveRadarrBlock> for SystemDetailsHandler
|
||||
}
|
||||
ActiveRadarrBlock::SystemTaskStartConfirmPrompt => {
|
||||
if self.app.data.radarr_data.prompt_confirm {
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::StartTask);
|
||||
self.app.data.radarr_data.prompt_confirm_action = Some(RadarrEvent::StartTask(None));
|
||||
}
|
||||
|
||||
self.app.pop_navigation_stack();
|
||||
|
||||
@@ -717,7 +717,7 @@ mod tests {
|
||||
assert!(app.data.radarr_data.prompt_confirm);
|
||||
assert_eq!(
|
||||
app.data.radarr_data.prompt_confirm_action,
|
||||
Some(RadarrEvent::StartTask)
|
||||
Some(RadarrEvent::StartTask(None))
|
||||
);
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
|
||||
Reference in New Issue
Block a user