feat(readarr): add the add author handler
Handles the add author search input, search results, and the multi-step add prompt covering root folder, monitor, monitor new items, quality profile, metadata profile, tags, and confirmation. Selecting a search result whose foreign author id already exists in the library routes to the already-in-library popup instead of the add prompt, so a duplicate add cannot be submitted.
This commit is contained in:
4 files changed
+2378
-4
No files matched your search
@@ -14,8 +14,8 @@ mod tests {
|
||||
use crate::models::HorizontallyScrollableText;
|
||||
use crate::models::readarr_models::{Author, AuthorStatistics, AuthorStatus};
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock, BOOK_DETAILS_BLOCKS, EDITION_DETAILS_BLOCKS,
|
||||
LIBRARY_BLOCKS,
|
||||
ADD_AUTHOR_BLOCKS, AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock, BOOK_DETAILS_BLOCKS,
|
||||
EDITION_DETAILS_BLOCKS, LIBRARY_BLOCKS,
|
||||
};
|
||||
use crate::test_handler_delegation;
|
||||
|
||||
@@ -889,6 +889,15 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_delegates_add_author_blocks_to_add_author_handler() {
|
||||
test_handler_delegation!(
|
||||
LibraryHandler,
|
||||
ActiveReadarrBlock::Authors,
|
||||
ActiveReadarrBlock::AddAuthorSearchInput
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_library_handler_accepts() {
|
||||
let mut library_handler_blocks = Vec::new();
|
||||
@@ -896,6 +905,7 @@ mod tests {
|
||||
library_handler_blocks.extend(AUTHOR_DETAILS_BLOCKS);
|
||||
library_handler_blocks.extend(BOOK_DETAILS_BLOCKS);
|
||||
library_handler_blocks.extend(EDITION_DETAILS_BLOCKS);
|
||||
library_handler_blocks.extend(ADD_AUTHOR_BLOCKS);
|
||||
|
||||
ActiveReadarrBlock::iter().for_each(|readarr_block| {
|
||||
if library_handler_blocks.contains(&readarr_block) {
|
||||
|
||||
Reference in new issue
Block a user