feat(readarr): add the edit author UI
Renders the edit author prompt with a snapshot per step of the selection state machine, seeding distinct quality and metadata profile values so a swap between the two dropdowns cannot go unnoticed.
This commit is contained in:
19 files changed
+1284
-2
No files matched your search
@@ -0,0 +1,270 @@
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use ratatui::Frame;
|
||||
use ratatui::layout::{Constraint, Rect};
|
||||
use ratatui::prelude::Layout;
|
||||
use ratatui::widgets::ListItem;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::Route;
|
||||
use crate::models::servarr_data::readarr::modals::EditAuthorModal;
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock, EDIT_AUTHOR_BLOCKS,
|
||||
};
|
||||
use crate::render_selectable_input_box;
|
||||
|
||||
use crate::ui::readarr_ui::library::author_details_ui::AuthorDetailsUi;
|
||||
use crate::ui::utils::title_block_centered;
|
||||
use crate::ui::widgets::button::Button;
|
||||
use crate::ui::widgets::checkbox::Checkbox;
|
||||
use crate::ui::widgets::input_box::InputBox;
|
||||
use crate::ui::widgets::popup::{Popup, Size};
|
||||
use crate::ui::widgets::selectable_list::SelectableList;
|
||||
use crate::ui::{DrawUi, draw_popup};
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "edit_author_ui_tests.rs"]
|
||||
mod edit_author_ui_tests;
|
||||
|
||||
pub(super) struct EditAuthorUi;
|
||||
|
||||
impl DrawUi for EditAuthorUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
let Route::Readarr(active_readarr_block, _) = route else {
|
||||
return false;
|
||||
};
|
||||
EDIT_AUTHOR_BLOCKS.contains(&active_readarr_block)
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
if let Route::Readarr(active_readarr_block, context_option) = app.get_current_route() {
|
||||
if let Some(context) = context_option
|
||||
&& AUTHOR_DETAILS_BLOCKS.contains(&context)
|
||||
{
|
||||
draw_popup(f, app, AuthorDetailsUi::draw, Size::Large);
|
||||
}
|
||||
|
||||
let draw_edit_author_prompt = |f: &mut Frame<'_>, app: &mut App<'_>, prompt_area: Rect| {
|
||||
draw_edit_author_confirmation_prompt(f, app, prompt_area);
|
||||
|
||||
match active_readarr_block {
|
||||
ActiveReadarrBlock::EditAuthorSelectMonitorNewItems => {
|
||||
draw_edit_author_select_monitor_new_items_popup(f, app);
|
||||
}
|
||||
ActiveReadarrBlock::EditAuthorSelectQualityProfile => {
|
||||
draw_edit_author_select_quality_profile_popup(f, app);
|
||||
}
|
||||
ActiveReadarrBlock::EditAuthorSelectMetadataProfile => {
|
||||
draw_edit_author_select_metadata_profile_popup(f, app);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
};
|
||||
|
||||
draw_popup(f, app, draw_edit_author_prompt, Size::Long);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn build_edit_author_prompt_title(author_name: &str, disambiguation: &str) -> String {
|
||||
if disambiguation.is_empty() {
|
||||
format!("Edit - {author_name}")
|
||||
} else {
|
||||
format!("Edit - {author_name} ({disambiguation})")
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
#[cfg_attr(test, derive(Debug))]
|
||||
struct EditAuthorPromptHighlights {
|
||||
monitored: bool,
|
||||
monitor_new_items: bool,
|
||||
quality_profile: bool,
|
||||
metadata_profile: bool,
|
||||
path: bool,
|
||||
tags: bool,
|
||||
confirm: bool,
|
||||
}
|
||||
|
||||
fn edit_author_prompt_highlights(selected_block: ActiveReadarrBlock) -> EditAuthorPromptHighlights {
|
||||
EditAuthorPromptHighlights {
|
||||
monitored: selected_block == ActiveReadarrBlock::EditAuthorToggleMonitored,
|
||||
monitor_new_items: selected_block == ActiveReadarrBlock::EditAuthorSelectMonitorNewItems,
|
||||
quality_profile: selected_block == ActiveReadarrBlock::EditAuthorSelectQualityProfile,
|
||||
metadata_profile: selected_block == ActiveReadarrBlock::EditAuthorSelectMetadataProfile,
|
||||
path: selected_block == ActiveReadarrBlock::EditAuthorPathInput,
|
||||
tags: selected_block == ActiveReadarrBlock::EditAuthorTagsInput,
|
||||
confirm: selected_block == ActiveReadarrBlock::EditAuthorConfirmPrompt,
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_edit_author_confirmation_prompt(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let author_name = app
|
||||
.data
|
||||
.readarr_data
|
||||
.authors
|
||||
.current_selection()
|
||||
.author_name
|
||||
.text
|
||||
.clone();
|
||||
let author_disambiguation = app
|
||||
.data
|
||||
.readarr_data
|
||||
.authors
|
||||
.current_selection()
|
||||
.disambiguation
|
||||
.clone()
|
||||
.unwrap_or_default();
|
||||
let title = build_edit_author_prompt_title(&author_name, &author_disambiguation);
|
||||
f.render_widget(title_block_centered(&title), area);
|
||||
|
||||
let yes_no_value = app.data.readarr_data.prompt_confirm;
|
||||
let selected_block = app.data.readarr_data.selected_block.get_active_block();
|
||||
let highlights = edit_author_prompt_highlights(selected_block);
|
||||
let EditAuthorModal {
|
||||
monitor_list,
|
||||
quality_profile_list,
|
||||
metadata_profile_list,
|
||||
monitored,
|
||||
path,
|
||||
tags,
|
||||
} = app
|
||||
.data
|
||||
.readarr_data
|
||||
.edit_author_modal
|
||||
.as_ref()
|
||||
.expect("edit_author_modal must exist in this context");
|
||||
let selected_monitor_new_items = monitor_list.current_selection();
|
||||
let selected_quality_profile = quality_profile_list.current_selection();
|
||||
let selected_metadata_profile = metadata_profile_list.current_selection();
|
||||
|
||||
let [
|
||||
_,
|
||||
monitored_area,
|
||||
monitor_new_items_area,
|
||||
quality_profile_area,
|
||||
metadata_profile_area,
|
||||
path_area,
|
||||
tags_area,
|
||||
_,
|
||||
buttons_area,
|
||||
] = Layout::vertical([
|
||||
Constraint::Fill(1),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Length(3),
|
||||
Constraint::Fill(1),
|
||||
Constraint::Length(3),
|
||||
])
|
||||
.margin(1)
|
||||
.areas(area);
|
||||
let [save_area, cancel_area] =
|
||||
Layout::horizontal([Constraint::Percentage(50), Constraint::Percentage(50)])
|
||||
.areas(buttons_area);
|
||||
|
||||
let monitored_checkbox = Checkbox::new("Monitored")
|
||||
.checked(monitored.unwrap_or_default())
|
||||
.highlighted(highlights.monitored);
|
||||
let monitor_new_items_drop_down_button = Button::default()
|
||||
.title(selected_monitor_new_items.to_display_str())
|
||||
.label("Monitor New Books")
|
||||
.icon("▼")
|
||||
.selected(highlights.monitor_new_items);
|
||||
let quality_profile_drop_down_button = Button::default()
|
||||
.title(selected_quality_profile)
|
||||
.label("Quality Profile")
|
||||
.icon("▼")
|
||||
.selected(highlights.quality_profile);
|
||||
let metadata_profile_drop_down_button = Button::default()
|
||||
.title(selected_metadata_profile)
|
||||
.label("Metadata Profile")
|
||||
.icon("▼")
|
||||
.selected(highlights.metadata_profile);
|
||||
|
||||
if let Route::Readarr(active_readarr_block, _) = app.get_current_route() {
|
||||
let path_input_box = InputBox::new(&path.text)
|
||||
.offset(path.offset.load(Ordering::SeqCst))
|
||||
.label("Path")
|
||||
.highlighted(highlights.path)
|
||||
.selected(active_readarr_block == ActiveReadarrBlock::EditAuthorPathInput);
|
||||
let tags_input_box = InputBox::new(&tags.text)
|
||||
.offset(tags.offset.load(Ordering::SeqCst))
|
||||
.label("Tags")
|
||||
.highlighted(highlights.tags)
|
||||
.selected(active_readarr_block == ActiveReadarrBlock::EditAuthorTagsInput);
|
||||
|
||||
match active_readarr_block {
|
||||
ActiveReadarrBlock::EditAuthorPathInput => path_input_box.show_cursor(f, path_area),
|
||||
ActiveReadarrBlock::EditAuthorTagsInput => tags_input_box.show_cursor(f, tags_area),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
render_selectable_input_box!(path_input_box, f, path_area);
|
||||
render_selectable_input_box!(tags_input_box, f, tags_area);
|
||||
}
|
||||
|
||||
let save_button = Button::default()
|
||||
.title("Save")
|
||||
.selected(yes_no_value && highlights.confirm);
|
||||
let cancel_button = Button::default()
|
||||
.title("Cancel")
|
||||
.selected(!yes_no_value && highlights.confirm);
|
||||
|
||||
f.render_widget(monitored_checkbox, monitored_area);
|
||||
f.render_widget(monitor_new_items_drop_down_button, monitor_new_items_area);
|
||||
f.render_widget(quality_profile_drop_down_button, quality_profile_area);
|
||||
f.render_widget(metadata_profile_drop_down_button, metadata_profile_area);
|
||||
f.render_widget(save_button, save_area);
|
||||
f.render_widget(cancel_button, cancel_area);
|
||||
}
|
||||
|
||||
fn draw_edit_author_select_monitor_new_items_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let monitor_list = SelectableList::new(
|
||||
&mut app
|
||||
.data
|
||||
.readarr_data
|
||||
.edit_author_modal
|
||||
.as_mut()
|
||||
.expect("edit_author_modal must exist in this context")
|
||||
.monitor_list,
|
||||
|monitor_type| ListItem::new(monitor_type.to_display_str().to_owned()),
|
||||
);
|
||||
let popup = Popup::new(monitor_list).size(Size::Dropdown);
|
||||
|
||||
f.render_widget(popup, f.area());
|
||||
}
|
||||
|
||||
fn draw_edit_author_select_quality_profile_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let quality_profile_list = SelectableList::new(
|
||||
&mut app
|
||||
.data
|
||||
.readarr_data
|
||||
.edit_author_modal
|
||||
.as_mut()
|
||||
.expect("edit_author_modal must exist in this context")
|
||||
.quality_profile_list,
|
||||
|quality_profile| ListItem::new(quality_profile.clone()),
|
||||
);
|
||||
let popup = Popup::new(quality_profile_list).size(Size::Dropdown);
|
||||
|
||||
f.render_widget(popup, f.area());
|
||||
}
|
||||
|
||||
fn draw_edit_author_select_metadata_profile_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let metadata_profile_list = SelectableList::new(
|
||||
&mut app
|
||||
.data
|
||||
.readarr_data
|
||||
.edit_author_modal
|
||||
.as_mut()
|
||||
.expect("edit_author_modal must exist in this context")
|
||||
.metadata_profile_list,
|
||||
|metadata_profile| ListItem::new(metadata_profile.clone()),
|
||||
);
|
||||
let popup = Popup::new(metadata_profile_list).size(Size::Dropdown);
|
||||
|
||||
f.render_widget(popup, f.area());
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use pretty_assertions::assert_eq;
|
||||
use pretty_assertions::assert_str_eq;
|
||||
use rstest::rstest;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
ActiveReadarrBlock, EDIT_AUTHOR_BLOCKS, EDIT_AUTHOR_SELECTION_BLOCKS,
|
||||
};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::readarr_ui::library::edit_author_ui::{
|
||||
EditAuthorPromptHighlights, EditAuthorUi, build_edit_author_prompt_title,
|
||||
edit_author_prompt_highlights,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn test_edit_author_ui_accepts() {
|
||||
ActiveReadarrBlock::iter().for_each(|active_readarr_block| {
|
||||
if EDIT_AUTHOR_BLOCKS.contains(&active_readarr_block) {
|
||||
assert!(EditAuthorUi::accepts(active_readarr_block.into()));
|
||||
} else {
|
||||
assert!(!EditAuthorUi::accepts(active_readarr_block.into()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_build_edit_author_prompt_title_without_disambiguation() {
|
||||
let title = build_edit_author_prompt_title("Test Author", "");
|
||||
|
||||
assert_str_eq!(title, "Edit - Test Author");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_build_edit_author_prompt_title_with_disambiguation() {
|
||||
let title = build_edit_author_prompt_title("Test Author", "American novelist");
|
||||
|
||||
assert_str_eq!(title, "Edit - Test Author (American novelist)");
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case(
|
||||
ActiveReadarrBlock::EditAuthorToggleMonitored,
|
||||
EditAuthorPromptHighlights {
|
||||
monitored: true,
|
||||
monitor_new_items: false,
|
||||
quality_profile: false,
|
||||
metadata_profile: false,
|
||||
path: false,
|
||||
tags: false,
|
||||
confirm: false,
|
||||
}
|
||||
)]
|
||||
#[case(
|
||||
ActiveReadarrBlock::EditAuthorSelectMonitorNewItems,
|
||||
EditAuthorPromptHighlights {
|
||||
monitored: false,
|
||||
monitor_new_items: true,
|
||||
quality_profile: false,
|
||||
metadata_profile: false,
|
||||
path: false,
|
||||
tags: false,
|
||||
confirm: false,
|
||||
}
|
||||
)]
|
||||
#[case(
|
||||
ActiveReadarrBlock::EditAuthorSelectQualityProfile,
|
||||
EditAuthorPromptHighlights {
|
||||
monitored: false,
|
||||
monitor_new_items: false,
|
||||
quality_profile: true,
|
||||
metadata_profile: false,
|
||||
path: false,
|
||||
tags: false,
|
||||
confirm: false,
|
||||
}
|
||||
)]
|
||||
#[case(
|
||||
ActiveReadarrBlock::EditAuthorSelectMetadataProfile,
|
||||
EditAuthorPromptHighlights {
|
||||
monitored: false,
|
||||
monitor_new_items: false,
|
||||
quality_profile: false,
|
||||
metadata_profile: true,
|
||||
path: false,
|
||||
tags: false,
|
||||
confirm: false,
|
||||
}
|
||||
)]
|
||||
#[case(
|
||||
ActiveReadarrBlock::EditAuthorPathInput,
|
||||
EditAuthorPromptHighlights {
|
||||
monitored: false,
|
||||
monitor_new_items: false,
|
||||
quality_profile: false,
|
||||
metadata_profile: false,
|
||||
path: true,
|
||||
tags: false,
|
||||
confirm: false,
|
||||
}
|
||||
)]
|
||||
#[case(
|
||||
ActiveReadarrBlock::EditAuthorTagsInput,
|
||||
EditAuthorPromptHighlights {
|
||||
monitored: false,
|
||||
monitor_new_items: false,
|
||||
quality_profile: false,
|
||||
metadata_profile: false,
|
||||
path: false,
|
||||
tags: true,
|
||||
confirm: false,
|
||||
}
|
||||
)]
|
||||
#[case(
|
||||
ActiveReadarrBlock::EditAuthorConfirmPrompt,
|
||||
EditAuthorPromptHighlights {
|
||||
monitored: false,
|
||||
monitor_new_items: false,
|
||||
quality_profile: false,
|
||||
metadata_profile: false,
|
||||
path: false,
|
||||
tags: false,
|
||||
confirm: true,
|
||||
}
|
||||
)]
|
||||
fn test_edit_author_prompt_highlights(
|
||||
#[case] selected_block: ActiveReadarrBlock,
|
||||
#[case] expected_highlights: EditAuthorPromptHighlights,
|
||||
) {
|
||||
let highlights = edit_author_prompt_highlights(selected_block);
|
||||
|
||||
assert_eq!(highlights, expected_highlights);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_edit_author_prompt_highlights_covers_every_selection_step() {
|
||||
for step in EDIT_AUTHOR_SELECTION_BLOCKS {
|
||||
let highlights = edit_author_prompt_highlights(step[0]);
|
||||
|
||||
assert_ne!(
|
||||
highlights,
|
||||
edit_author_prompt_highlights(ActiveReadarrBlock::Authors)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
|
||||
use super::*;
|
||||
use crate::app::App;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
fn seed_distinct_profile_lists(app: &mut App<'_>) {
|
||||
let edit_author_modal = app
|
||||
.data
|
||||
.readarr_data
|
||||
.edit_author_modal
|
||||
.as_mut()
|
||||
.expect("edit_author_modal must exist in this context");
|
||||
edit_author_modal
|
||||
.quality_profile_list
|
||||
.set_items(vec!["eBook".to_owned()]);
|
||||
edit_author_modal
|
||||
.metadata_profile_list
|
||||
.set_items(vec!["Author Only".to_owned()]);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case(0, ActiveReadarrBlock::EditAuthorToggleMonitored)]
|
||||
#[case(1, ActiveReadarrBlock::EditAuthorSelectMonitorNewItems)]
|
||||
#[case(2, ActiveReadarrBlock::EditAuthorSelectQualityProfile)]
|
||||
#[case(3, ActiveReadarrBlock::EditAuthorSelectMetadataProfile)]
|
||||
#[case(4, ActiveReadarrBlock::EditAuthorPathInput)]
|
||||
#[case(5, ActiveReadarrBlock::EditAuthorTagsInput)]
|
||||
#[case(6, ActiveReadarrBlock::EditAuthorConfirmPrompt)]
|
||||
fn test_edit_author_ui_renders_step(
|
||||
#[case] step: usize,
|
||||
#[case] selected_readarr_block: ActiveReadarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveReadarrBlock::EditAuthorPrompt.into());
|
||||
seed_distinct_profile_lists(&mut app);
|
||||
let mut selected_block = BlockSelectionState::new(EDIT_AUTHOR_SELECTION_BLOCKS);
|
||||
selected_block.set_index(0, step);
|
||||
app.data.readarr_data.selected_block = selected_block;
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
EditAuthorUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(
|
||||
format!("edit_author_step_{step}_{selected_readarr_block}"),
|
||||
output
|
||||
);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case(1, ActiveReadarrBlock::EditAuthorSelectMonitorNewItems)]
|
||||
#[case(2, ActiveReadarrBlock::EditAuthorSelectQualityProfile)]
|
||||
#[case(3, ActiveReadarrBlock::EditAuthorSelectMetadataProfile)]
|
||||
#[case(4, ActiveReadarrBlock::EditAuthorPathInput)]
|
||||
#[case(5, ActiveReadarrBlock::EditAuthorTagsInput)]
|
||||
fn test_edit_author_ui_renders_active_block(
|
||||
#[case] step: usize,
|
||||
#[case] active_readarr_block: ActiveReadarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_readarr_block.into());
|
||||
seed_distinct_profile_lists(&mut app);
|
||||
let mut selected_block = BlockSelectionState::new(EDIT_AUTHOR_SELECTION_BLOCKS);
|
||||
selected_block.set_index(0, step);
|
||||
app.data.readarr_data.selected_block = selected_block;
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
EditAuthorUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(format!("edit_author_active_{active_readarr_block}"), output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_edit_author_ui_renders_unmonitored_author() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveReadarrBlock::EditAuthorPrompt.into());
|
||||
seed_distinct_profile_lists(&mut app);
|
||||
app.data.readarr_data.selected_block = BlockSelectionState::new(EDIT_AUTHOR_SELECTION_BLOCKS);
|
||||
app
|
||||
.data
|
||||
.readarr_data
|
||||
.edit_author_modal
|
||||
.as_mut()
|
||||
.expect("edit_author_modal must exist in this context")
|
||||
.monitored = Some(false);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
EditAuthorUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_edit_author_ui_renders_over_author_details() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveReadarrBlock::AuthorDetails.into());
|
||||
seed_distinct_profile_lists(&mut app);
|
||||
app.data.readarr_data.selected_block = BlockSelectionState::new(EDIT_AUTHOR_SELECTION_BLOCKS);
|
||||
app.push_navigation_stack(
|
||||
(
|
||||
ActiveReadarrBlock::EditAuthorPrompt,
|
||||
Some(ActiveReadarrBlock::AuthorDetails),
|
||||
)
|
||||
.into(),
|
||||
);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
EditAuthorUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ mod tests {
|
||||
use crate::models::readarr_models::{Author, AuthorStatistics, AuthorStatus};
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
ADD_AUTHOR_BLOCKS, AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock, BOOK_DETAILS_BLOCKS,
|
||||
EDITION_DETAILS_BLOCKS, LIBRARY_BLOCKS,
|
||||
EDIT_AUTHOR_BLOCKS, EDITION_DETAILS_BLOCKS, LIBRARY_BLOCKS,
|
||||
};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::readarr_ui::library::{LibraryUi, decorate_author_row_with_style};
|
||||
@@ -20,6 +20,7 @@ mod tests {
|
||||
blocks.extend(BOOK_DETAILS_BLOCKS);
|
||||
blocks.extend(EDITION_DETAILS_BLOCKS);
|
||||
blocks.extend(ADD_AUTHOR_BLOCKS);
|
||||
blocks.extend(EDIT_AUTHOR_BLOCKS);
|
||||
|
||||
for active_readarr_block in ActiveReadarrBlock::iter() {
|
||||
if blocks.contains(&active_readarr_block) {
|
||||
@@ -187,7 +188,10 @@ mod tests {
|
||||
|
||||
mod snapshot_tests {
|
||||
use crate::app::App;
|
||||
use crate::models::servarr_data::readarr::readarr_data::ActiveReadarrBlock;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
ActiveReadarrBlock, EDIT_AUTHOR_SELECTION_BLOCKS,
|
||||
};
|
||||
use rstest::rstest;
|
||||
|
||||
use crate::ui::DrawUi;
|
||||
@@ -279,5 +283,19 @@ mod tests {
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_library_ui_renders_edit_author_over_library() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveReadarrBlock::Authors.into());
|
||||
app.data.readarr_data.selected_block = BlockSelectionState::new(EDIT_AUTHOR_SELECTION_BLOCKS);
|
||||
app.push_navigation_stack(ActiveReadarrBlock::EditAuthorPrompt.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
LibraryUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
use add_author_ui::AddAuthorUi;
|
||||
use author_details_ui::AuthorDetailsUi;
|
||||
use edit_author_ui::EditAuthorUi;
|
||||
use ratatui::{
|
||||
Frame,
|
||||
layout::{Constraint, Rect},
|
||||
@@ -29,6 +30,7 @@ use crate::{
|
||||
mod add_author_ui;
|
||||
mod author_details_ui;
|
||||
mod book_details_ui;
|
||||
mod edit_author_ui;
|
||||
mod edition_details_ui;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -41,6 +43,7 @@ impl DrawUi for LibraryUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
if let Route::Readarr(active_readarr_block, _) = route {
|
||||
return AddAuthorUi::accepts(route)
|
||||
|| EditAuthorUi::accepts(route)
|
||||
|| AuthorDetailsUi::accepts(route)
|
||||
|| LIBRARY_BLOCKS.contains(&active_readarr_block);
|
||||
}
|
||||
@@ -55,6 +58,7 @@ impl DrawUi for LibraryUi {
|
||||
match route {
|
||||
_ if AddAuthorUi::accepts(route) => AddAuthorUi::draw(f, app, area),
|
||||
_ if AuthorDetailsUi::accepts(route) => AuthorDetailsUi::draw(f, app, area),
|
||||
_ if EditAuthorUi::accepts(route) => EditAuthorUi::draw(f, app, area),
|
||||
Route::Readarr(ActiveReadarrBlock::UpdateAllAuthorsPrompt, _) => {
|
||||
let confirmation_prompt = ConfirmationPrompt::new()
|
||||
.title("Update All Authors")
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭───────────────────────────────╮──────────────────────────────╮ │
|
||||
│ Monito│Author Only │ ▼ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ Qual│ │ ▼ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ Metad│ │ ▼ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ │ │ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ │ │ │ │
|
||||
│ ╰───────────────────────────────╯──────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭───────────────────────────────╮──────────────────────────────╮ │
|
||||
│ Monito│All Books │ ▼ │ │
|
||||
│ │No New Books │──────────────────────────────╯ │
|
||||
│ │New Books │──────────────────────────────╮ │
|
||||
│ Qual│ │ ▼ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ Metad│ │ ▼ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ │ │ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ │ │ │ │
|
||||
│ ╰───────────────────────────────╯──────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭───────────────────────────────╮──────────────────────────────╮ │
|
||||
│ Monito│eBook │ ▼ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ Qual│ │ ▼ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ Metad│ │ ▼ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ │ │ │ │
|
||||
│ │ │──────────────────────────────╯ │
|
||||
│ │ │──────────────────────────────╮ │
|
||||
│ │ │ │ │
|
||||
│ ╰───────────────────────────────╯──────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing ╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮ │
|
||||
│Genres: science fic│ │ │
|
||||
│Rating: N/A │ │ │
|
||||
│Path: /nfs/books/Te│ │ │
|
||||
│Quality Profile: St│ │ │
|
||||
│Metadata Profile: S│ │ │
|
||||
│Monitored: Yes │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ ╭───╮ │ │
|
||||
│╭ Author Details │ Monitored: │ ✔ │ │────────────────────╮│
|
||||
││ Books │ History ││ ╰───╯ │ ││
|
||||
││──────────────────│ ╭─────────────────────────────────────────────────╮ │────────────────────││
|
||||
││ Monitored │ Monitor New Books: │All Books ▼ │ │ ││
|
||||
││=> 🏷 │ ╰─────────────────────────────────────────────────╯ │B ││
|
||||
││ │ ╭─────────────────────────────────────────────────╮ │ ││
|
||||
││ │ Quality Profile: │eBook ▼ │ │ ││
|
||||
││ │ ╰─────────────────────────────────────────────────╯ │ ││
|
||||
││ │ ╭─────────────────────────────────────────────────╮ │ ││
|
||||
││ │ Metadata Profile: │Author Only ▼ │ │ ││
|
||||
││ │ ╰─────────────────────────────────────────────────╯ │ ││
|
||||
││ │ ╭─────────────────────────────────────────────────╮ │ ││
|
||||
││ │ Path: │/nfs/books │ │ ││
|
||||
││ │ ╰─────────────────────────────────────────────────╯ │ ││
|
||||
││ │ ╭─────────────────────────────────────────────────╮ │ ││
|
||||
││ │ Tags: │alex │ │ ││
|
||||
││ │ ╰─────────────────────────────────────────────────╯ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│ ││
|
||||
││ ││ Save ││ Cancel ││ ││
|
||||
││ │╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/edit_author_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │eBook ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Author Only ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/library_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Standard 0 0.00 GB 🏷 alex
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────── Edit - Test Author ──────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Monitor New Books: │All Books ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │Standard ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Metadata Profile: │Standard ▼ │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Path: │/nfs/books │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ ╭─────────────────────────────────────────────────╮ │
|
||||
│ Tags: │alex │ │
|
||||
│ ╰─────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────────╮╭──────────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────────╯╰──────────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
Reference in new issue
Block a user