feat(handlers): Sonarr key support for the Series table

This commit is contained in:
2024-12-01 13:48:48 -07:00
parent 21911f93d1
commit c3fb5dcd5f
19 changed files with 2900 additions and 82 deletions
@@ -28,6 +28,7 @@ mod tests {
test_iterable_scroll!(
test_blocklist_scroll,
BlocklistHandler,
radarr_data,
blocklist,
simple_stateful_iterable_vec!(BlocklistItem, String, source_title),
ActiveRadarrBlock::Blocklist,
@@ -136,6 +137,7 @@ mod tests {
test_iterable_home_and_end!(
test_blocklist_home_and_end,
BlocklistHandler,
radarr_data,
blocklist,
extended_stateful_iterable_vec!(BlocklistItem, String, source_title),
ActiveRadarrBlock::Blocklist,
@@ -24,6 +24,7 @@ mod tests {
test_iterable_scroll!(
test_collection_details_scroll,
CollectionDetailsHandler,
radarr_data,
collection_movies,
simple_stateful_iterable_vec!(CollectionMovie, HorizontallyScrollableText),
ActiveRadarrBlock::CollectionDetails,
@@ -88,6 +89,7 @@ mod tests {
test_iterable_home_and_end!(
test_collection_details_home_end,
CollectionDetailsHandler,
radarr_data,
collection_movies,
extended_stateful_iterable_vec!(CollectionMovie, HorizontallyScrollableText),
ActiveRadarrBlock::CollectionDetails,
@@ -34,6 +34,7 @@ mod tests {
test_iterable_scroll!(
test_collections_scroll,
CollectionsHandler,
radarr_data,
collections,
simple_stateful_iterable_vec!(Collection, HorizontallyScrollableText),
ActiveRadarrBlock::Collections,
@@ -153,6 +154,7 @@ mod tests {
test_iterable_home_and_end!(
test_collections_home_end,
CollectionsHandler,
radarr_data,
collections,
extended_stateful_iterable_vec!(Collection, HorizontallyScrollableText),
ActiveRadarrBlock::Collections,
@@ -22,6 +22,7 @@ mod tests {
test_iterable_scroll!(
test_downloads_scroll,
DownloadsHandler,
radarr_data,
downloads,
DownloadRecord,
ActiveRadarrBlock::Downloads,
@@ -69,6 +70,7 @@ mod tests {
test_iterable_home_and_end!(
test_downloads_home_end,
DownloadsHandler,
radarr_data,
downloads,
DownloadRecord,
ActiveRadarrBlock::Downloads,
@@ -25,6 +25,7 @@ mod tests {
test_iterable_scroll!(
test_indexers_scroll,
IndexersHandler,
radarr_data,
indexers,
simple_stateful_iterable_vec!(Indexer, String, protocol),
ActiveRadarrBlock::Indexers,
@@ -71,6 +72,7 @@ mod tests {
test_iterable_home_and_end!(
test_indexers_home_end,
IndexersHandler,
radarr_data,
indexers,
extended_stateful_iterable_vec!(Indexer, String, protocol),
ActiveRadarrBlock::Indexers,
@@ -30,6 +30,7 @@ mod tests {
test_iterable_scroll!(
test_movies_scroll,
LibraryHandler,
radarr_data,
movies,
simple_stateful_iterable_vec!(Movie, HorizontallyScrollableText),
ActiveRadarrBlock::Movies,
@@ -134,6 +135,7 @@ mod tests {
test_iterable_home_and_end!(
test_movies_home_end,
LibraryHandler,
radarr_data,
movies,
extended_stateful_iterable_vec!(Movie, HorizontallyScrollableText),
ActiveRadarrBlock::Movies,
@@ -228,48 +228,4 @@ mod utils {
);
};
}
#[macro_export]
macro_rules! assert_delete_prompt {
($block:expr, $expected_block:expr) => {
let mut app = App::default();
RadarrHandler::with(DELETE_KEY, &mut app, $block, None).handle();
assert_eq!(app.get_current_route(), $expected_block.into());
};
($handler:ident, $block:expr, $expected_block:expr) => {
let mut app = App::default();
$handler::with(DELETE_KEY, &mut app, $block, None).handle();
assert_eq!(app.get_current_route(), $expected_block.into());
};
($app:expr, $block:expr, $expected_block:expr) => {
RadarrHandler::with(DELETE_KEY, &mut $app, $block, None).handle();
assert_eq!($app.get_current_route(), $expected_block.into());
};
($handler:ident, $app:expr, $block:expr, $expected_block:expr) => {
$handler::with(DELETE_KEY, &mut $app, $block, None).handle();
assert_eq!($app.get_current_route(), $expected_block.into());
};
}
#[macro_export]
macro_rules! assert_refresh_key {
($handler:ident, $block:expr) => {
let mut app = App::default();
app.push_navigation_stack($block.into());
$handler::with(DEFAULT_KEYBINDINGS.refresh.key, &mut app, $block, None).handle();
assert_eq!(app.get_current_route(), $block.into());
assert!(app.should_refresh);
};
}
}
@@ -23,6 +23,7 @@ mod tests {
test_iterable_scroll!(
test_root_folders_scroll,
RootFoldersHandler,
radarr_data,
root_folders,
simple_stateful_iterable_vec!(RootFolder, String, path),
ActiveRadarrBlock::RootFolders,
@@ -71,6 +72,7 @@ mod tests {
test_iterable_home_and_end!(
test_root_folders_home_end,
RootFoldersHandler,
radarr_data,
root_folders,
extended_stateful_iterable_vec!(RootFolder, String, path),
ActiveRadarrBlock::RootFolders,
@@ -26,6 +26,7 @@ mod tests {
test_iterable_scroll!(
test_log_details_scroll,
SystemDetailsHandler,
radarr_data,
log_details,
simple_stateful_iterable_vec!(HorizontallyScrollableText, String, text),
ActiveRadarrBlock::SystemLogs,
@@ -241,6 +242,7 @@ mod tests {
test_iterable_home_and_end!(
test_log_details_home_end,
SystemDetailsHandler,
radarr_data,
log_details,
extended_stateful_iterable_vec!(HorizontallyScrollableText, String, text),
ActiveRadarrBlock::SystemLogs,