feat(readarr): render the author details view
Add AuthorDetailsUi: the author description pane plus the three author info tabs (Books, History, and Author Search), along with the history item details, automatic search, update and scan, and manual search confirmation popups. LibraryUi now accepts and draws it over the authors table. The description pane omits the Disambiguation and Type lines that the Lidarr equivalent renders. GET /author returns neither key, so both lines would be blank on every record. The books table drops the Type and Duration columns for the same reason, since books have no type and no duration, and renders Files as the book file count over the total book count. Land create_history_event_details together with this first caller so it is not committed as an unused function. Extract decorate_book_row_with_style rather than inlining the row styling in the table closure, matching decorate_author_row_with_style in the sibling library view. Rendering to a string discards colour, so the styling branches are only reachable by tests through a named function.
This commit is contained in:
37 files changed
+3118
-3
No files matched your search
@@ -0,0 +1,587 @@
|
||||
use chrono::Utc;
|
||||
use deunicode::deunicode;
|
||||
use ratatui::Frame;
|
||||
use ratatui::layout::{Constraint, Layout, Rect};
|
||||
use ratatui::style::Stylize;
|
||||
use ratatui::text::Line;
|
||||
use ratatui::widgets::{Cell, Paragraph, Row, Wrap};
|
||||
use regex::Regex;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::Route;
|
||||
use crate::models::readarr_models::{Book, ReadarrHistoryItem, ReadarrRelease};
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock,
|
||||
};
|
||||
use crate::ui::readarr_ui::readarr_ui_utils::create_history_event_details;
|
||||
use crate::ui::styles::{ManagarrStyle, secondary_style};
|
||||
use crate::ui::utils::decorate_peer_style;
|
||||
use crate::ui::utils::{
|
||||
borderless_block, get_width_from_percentage, layout_block_top_border, title_block,
|
||||
};
|
||||
use crate::ui::widgets::confirmation_prompt::ConfirmationPrompt;
|
||||
use crate::ui::widgets::loading_block::LoadingBlock;
|
||||
use crate::ui::widgets::managarr_table::ManagarrTable;
|
||||
use crate::ui::widgets::message::Message;
|
||||
use crate::ui::widgets::popup::{Popup, Size};
|
||||
use crate::ui::{DrawUi, draw_popup, draw_tabs};
|
||||
use crate::utils::convert_to_gb;
|
||||
use ratatui::layout::Alignment;
|
||||
use ratatui::text::Text;
|
||||
use serde_json::Number;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "author_details_ui_tests.rs"]
|
||||
mod author_details_ui_tests;
|
||||
|
||||
pub(super) struct AuthorDetailsUi;
|
||||
|
||||
impl DrawUi for AuthorDetailsUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
let Route::Readarr(active_readarr_block, _) = route else {
|
||||
return false;
|
||||
};
|
||||
AUTHOR_DETAILS_BLOCKS.contains(&active_readarr_block)
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
let route = app.get_current_route();
|
||||
if let Route::Readarr(active_readarr_block, _) = route {
|
||||
let draw_author_details_popup = |f: &mut Frame<'_>, app: &mut App<'_>, popup_area: Rect| {
|
||||
f.render_widget(
|
||||
title_block(
|
||||
&app
|
||||
.data
|
||||
.readarr_data
|
||||
.authors
|
||||
.current_selection()
|
||||
.author_name
|
||||
.text,
|
||||
),
|
||||
popup_area,
|
||||
);
|
||||
let [description_area, detail_area] =
|
||||
Layout::vertical([Constraint::Length(12), Constraint::Fill(0)])
|
||||
.margin(1)
|
||||
.areas(popup_area);
|
||||
draw_author_description(f, app, description_area);
|
||||
let content_area = draw_tabs(
|
||||
f,
|
||||
detail_area,
|
||||
"Author Details",
|
||||
&app.data.readarr_data.author_info_tabs,
|
||||
);
|
||||
draw_author_details(f, app, content_area);
|
||||
|
||||
match active_readarr_block {
|
||||
ActiveReadarrBlock::AuthorHistoryDetails => {
|
||||
draw_author_history_item_details_popup(f, app);
|
||||
}
|
||||
ActiveReadarrBlock::AutomaticallySearchAuthorPrompt => {
|
||||
let prompt = format!(
|
||||
"Do you want to trigger an automatic search of your indexers for all monitored book(s) for the author: {}?",
|
||||
app
|
||||
.data
|
||||
.readarr_data
|
||||
.authors
|
||||
.current_selection()
|
||||
.author_name
|
||||
);
|
||||
let confirmation_prompt = ConfirmationPrompt::new()
|
||||
.title("Automatic Author Search")
|
||||
.prompt(&prompt)
|
||||
.yes_no_value(app.data.readarr_data.prompt_confirm);
|
||||
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::MediumPrompt),
|
||||
f.area(),
|
||||
);
|
||||
}
|
||||
ActiveReadarrBlock::UpdateAndScanAuthorPrompt => {
|
||||
let prompt = format!(
|
||||
"Do you want to trigger an update and disk scan for the author: {}?",
|
||||
app
|
||||
.data
|
||||
.readarr_data
|
||||
.authors
|
||||
.current_selection()
|
||||
.author_name
|
||||
);
|
||||
let confirmation_prompt = ConfirmationPrompt::new()
|
||||
.title("Update and Scan")
|
||||
.prompt(&prompt)
|
||||
.yes_no_value(app.data.readarr_data.prompt_confirm);
|
||||
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::MediumPrompt),
|
||||
f.area(),
|
||||
);
|
||||
}
|
||||
ActiveReadarrBlock::ManualAuthorSearchConfirmPrompt => {
|
||||
draw_manual_author_search_confirm_prompt(f, app);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
};
|
||||
|
||||
draw_popup(f, app, draw_author_details_popup, Size::XXLarge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_author_description(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let current_selection = app.data.readarr_data.authors.current_selection();
|
||||
let monitored = if current_selection.monitored {
|
||||
"Yes"
|
||||
} else {
|
||||
"No"
|
||||
};
|
||||
let quality_profile = app
|
||||
.data
|
||||
.readarr_data
|
||||
.quality_profile_map
|
||||
.get_by_left(¤t_selection.quality_profile_id)
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
let metadata_profile = app
|
||||
.data
|
||||
.readarr_data
|
||||
.metadata_profile_map
|
||||
.get_by_left(¤t_selection.metadata_profile_id)
|
||||
.cloned()
|
||||
.unwrap_or_default();
|
||||
let overview = Regex::new(r"[\r\n\t]")
|
||||
.unwrap()
|
||||
.replace_all(
|
||||
&deunicode(
|
||||
current_selection
|
||||
.overview
|
||||
.as_ref()
|
||||
.unwrap_or(&String::new()),
|
||||
),
|
||||
"",
|
||||
)
|
||||
.to_string();
|
||||
|
||||
let mut author_description = vec![
|
||||
Line::from(vec![
|
||||
"Author: ".primary().bold(),
|
||||
current_selection.author_name.text.clone().primary().bold(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Overview: ".primary().bold(),
|
||||
overview.default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Status: ".primary().bold(),
|
||||
current_selection.status.to_display_str().default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Genres: ".primary().bold(),
|
||||
current_selection.genres.join(", ").default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Rating: ".primary().bold(),
|
||||
current_selection
|
||||
.ratings
|
||||
.as_ref()
|
||||
.map_or_else(
|
||||
|| "N/A".to_owned(),
|
||||
|r| format!("{}%", (r.value * 10.0) as i32),
|
||||
)
|
||||
.default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Path: ".primary().bold(),
|
||||
current_selection.path.clone().default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Quality Profile: ".primary().bold(),
|
||||
quality_profile.default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Metadata Profile: ".primary().bold(),
|
||||
metadata_profile.default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Monitored: ".primary().bold(),
|
||||
monitored.default_color(),
|
||||
]),
|
||||
];
|
||||
|
||||
if let Some(stats) = current_selection.statistics.as_ref() {
|
||||
let size = convert_to_gb(stats.size_on_disk);
|
||||
author_description.extend(vec![
|
||||
Line::from(vec![
|
||||
"Books: ".primary().bold(),
|
||||
stats.book_count.to_string().default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Files: ".primary().bold(),
|
||||
format!("{}/{}", stats.book_file_count, stats.total_book_count).default_color(),
|
||||
]),
|
||||
Line::from(vec![
|
||||
"Size on Disk: ".primary().bold(),
|
||||
format!("{size:.2} GB").default_color(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
let description_paragraph = Paragraph::new(author_description)
|
||||
.block(borderless_block())
|
||||
.wrap(Wrap { trim: true });
|
||||
f.render_widget(description_paragraph, area);
|
||||
}
|
||||
|
||||
fn draw_author_details(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Readarr(active_readarr_block, _) =
|
||||
app.data.readarr_data.author_info_tabs.get_active_route()
|
||||
{
|
||||
match active_readarr_block {
|
||||
ActiveReadarrBlock::AuthorDetails => draw_books_table(f, app, area),
|
||||
ActiveReadarrBlock::AuthorHistory => draw_author_history_table(f, app, area),
|
||||
ActiveReadarrBlock::ManualAuthorSearch => draw_author_releases(f, app, area),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_books_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if let Route::Readarr(active_readarr_block, _) = app.get_current_route() {
|
||||
let current_selection = if app.data.readarr_data.books.is_empty() {
|
||||
Book::default()
|
||||
} else {
|
||||
app.data.readarr_data.books.current_selection().clone()
|
||||
};
|
||||
let content = Some(&mut app.data.readarr_data.books);
|
||||
let book_row_mapping = |book: &Book| {
|
||||
book.title.scroll_left_or_reset(
|
||||
get_width_from_percentage(area, 38),
|
||||
*book == current_selection,
|
||||
app.should_text_scroll,
|
||||
);
|
||||
let monitored = if book.monitored { "🏷" } else { "" };
|
||||
let release_date = book
|
||||
.release_date
|
||||
.map_or_else(|| "N/A".to_owned(), |d| d.format("%Y-%m-%d").to_string());
|
||||
let book_file_count = book.statistics.as_ref().map_or_else(
|
||||
|| "0/0".to_owned(),
|
||||
|s| format!("{}/{}", s.book_file_count, s.total_book_count),
|
||||
);
|
||||
let size = book
|
||||
.statistics
|
||||
.as_ref()
|
||||
.map_or(0f64, |s| convert_to_gb(s.size_on_disk));
|
||||
|
||||
decorate_book_row_with_style(
|
||||
book,
|
||||
Row::new(vec![
|
||||
Cell::from(monitored.to_owned()),
|
||||
Cell::from(book.title.to_string()),
|
||||
Cell::from(book_file_count),
|
||||
Cell::from(release_date),
|
||||
Cell::from(format!("{size:.2} GB")),
|
||||
]),
|
||||
)
|
||||
};
|
||||
|
||||
let is_searching = active_readarr_block == ActiveReadarrBlock::SearchBooks;
|
||||
let book_table = ManagarrTable::new(content, book_row_mapping)
|
||||
.block(layout_block_top_border())
|
||||
.loading(app.is_loading)
|
||||
.searching(is_searching)
|
||||
.search_produced_empty_results(active_readarr_block == ActiveReadarrBlock::SearchBooksError)
|
||||
.headers(["Monitored", "Title", "Files", "Release Date", "Size"])
|
||||
.constraints([
|
||||
Constraint::Percentage(10),
|
||||
Constraint::Percentage(40),
|
||||
Constraint::Percentage(15),
|
||||
Constraint::Percentage(17),
|
||||
Constraint::Percentage(18),
|
||||
]);
|
||||
|
||||
if is_searching {
|
||||
book_table.show_cursor(f, area);
|
||||
}
|
||||
|
||||
f.render_widget(book_table, area);
|
||||
}
|
||||
}
|
||||
|
||||
fn decorate_book_row_with_style<'a>(book: &Book, row: Row<'a>) -> Row<'a> {
|
||||
if !book.monitored {
|
||||
row.unmonitored()
|
||||
} else if let Some(stats) = book.statistics.as_ref() {
|
||||
if stats.book_file_count == stats.total_book_count && stats.total_book_count > 0 {
|
||||
row.downloaded()
|
||||
} else if let Some(release_date) = book.release_date.as_ref() {
|
||||
if release_date > &Utc::now() {
|
||||
row.unreleased()
|
||||
} else {
|
||||
row.missing()
|
||||
}
|
||||
} else {
|
||||
row.missing()
|
||||
}
|
||||
} else {
|
||||
row.indeterminate()
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_author_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
if !app.is_loading {
|
||||
let current_selection = if app.data.readarr_data.author_history.is_empty() {
|
||||
ReadarrHistoryItem::default()
|
||||
} else {
|
||||
app
|
||||
.data
|
||||
.readarr_data
|
||||
.author_history
|
||||
.current_selection()
|
||||
.clone()
|
||||
};
|
||||
|
||||
if let Route::Readarr(active_readarr_block, _) = app.get_current_route() {
|
||||
let history_row_mapping = |history_item: &ReadarrHistoryItem| {
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
quality,
|
||||
event_type,
|
||||
date,
|
||||
..
|
||||
} = history_item;
|
||||
|
||||
source_title.scroll_left_or_reset(
|
||||
get_width_from_percentage(area, 40),
|
||||
current_selection == *history_item,
|
||||
app.should_text_scroll,
|
||||
);
|
||||
|
||||
Row::new(vec![
|
||||
Cell::from(source_title.to_string()),
|
||||
Cell::from(event_type.to_string()),
|
||||
Cell::from(quality.quality.name.to_owned()),
|
||||
Cell::from(date.to_string()),
|
||||
])
|
||||
.primary()
|
||||
};
|
||||
let history_table = ManagarrTable::new(
|
||||
Some(&mut app.data.readarr_data.author_history),
|
||||
history_row_mapping,
|
||||
)
|
||||
.block(layout_block_top_border())
|
||||
.loading(app.is_loading)
|
||||
.sorting(active_readarr_block == ActiveReadarrBlock::AuthorHistorySortPrompt)
|
||||
.searching(active_readarr_block == ActiveReadarrBlock::SearchAuthorHistory)
|
||||
.search_produced_empty_results(
|
||||
active_readarr_block == ActiveReadarrBlock::SearchAuthorHistoryError,
|
||||
)
|
||||
.filtering(active_readarr_block == ActiveReadarrBlock::FilterAuthorHistory)
|
||||
.filter_produced_empty_results(
|
||||
active_readarr_block == ActiveReadarrBlock::FilterAuthorHistoryError,
|
||||
)
|
||||
.headers(["Source Title", "Event Type", "Quality", "Date"])
|
||||
.constraints([
|
||||
Constraint::Percentage(40),
|
||||
Constraint::Percentage(20),
|
||||
Constraint::Percentage(15),
|
||||
Constraint::Percentage(25),
|
||||
]);
|
||||
|
||||
if [
|
||||
ActiveReadarrBlock::SearchAuthorHistory,
|
||||
ActiveReadarrBlock::FilterAuthorHistory,
|
||||
]
|
||||
.contains(&active_readarr_block)
|
||||
{
|
||||
history_table.show_cursor(f, area);
|
||||
}
|
||||
|
||||
f.render_widget(history_table, area);
|
||||
}
|
||||
} else {
|
||||
f.render_widget(
|
||||
LoadingBlock::new(
|
||||
app.is_loading || app.data.readarr_data.books.is_empty(),
|
||||
layout_block_top_border(),
|
||||
),
|
||||
area,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_author_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let current_selection = if app.data.readarr_data.author_history.is_empty() {
|
||||
ReadarrHistoryItem::default()
|
||||
} else {
|
||||
app
|
||||
.data
|
||||
.readarr_data
|
||||
.author_history
|
||||
.current_selection()
|
||||
.clone()
|
||||
};
|
||||
|
||||
let line_vec = create_history_event_details(current_selection);
|
||||
let text = Text::from(line_vec);
|
||||
|
||||
let message = Message::new(text)
|
||||
.title("Details")
|
||||
.style(secondary_style())
|
||||
.alignment(Alignment::Left);
|
||||
|
||||
f.render_widget(Popup::new(message).size(Size::NarrowLongMessage), f.area());
|
||||
}
|
||||
|
||||
fn draw_author_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let (current_selection, is_empty) = if app.data.readarr_data.author_releases.is_empty() {
|
||||
(ReadarrRelease::default(), true)
|
||||
} else {
|
||||
(
|
||||
app
|
||||
.data
|
||||
.readarr_data
|
||||
.author_releases
|
||||
.current_selection()
|
||||
.clone(),
|
||||
app.data.readarr_data.author_releases.is_empty(),
|
||||
)
|
||||
};
|
||||
|
||||
if let Route::Readarr(active_readarr_block, _) = app.get_current_route() {
|
||||
let release_row_mapping = |release: &ReadarrRelease| {
|
||||
let ReadarrRelease {
|
||||
protocol,
|
||||
age,
|
||||
title,
|
||||
indexer,
|
||||
size,
|
||||
rejected,
|
||||
seeders,
|
||||
leechers,
|
||||
quality,
|
||||
..
|
||||
} = release;
|
||||
|
||||
let age = format!("{age} days");
|
||||
title.scroll_left_or_reset(
|
||||
get_width_from_percentage(area, 35),
|
||||
current_selection == *release
|
||||
&& active_readarr_block != ActiveReadarrBlock::ManualAuthorSearchConfirmPrompt,
|
||||
app.should_text_scroll,
|
||||
);
|
||||
let size = convert_to_gb(*size);
|
||||
let rejected_str = if *rejected { "⛔" } else { "" };
|
||||
let peers = if seeders.is_none() || leechers.is_none() {
|
||||
Text::from("")
|
||||
} else {
|
||||
let seeders = seeders
|
||||
.clone()
|
||||
.unwrap_or(Number::from(0u64))
|
||||
.as_u64()
|
||||
.unwrap_or_default();
|
||||
let leechers = leechers
|
||||
.clone()
|
||||
.unwrap_or(Number::from(0u64))
|
||||
.as_u64()
|
||||
.unwrap_or_default();
|
||||
|
||||
decorate_peer_style(
|
||||
seeders,
|
||||
leechers,
|
||||
Text::from(format!("{seeders} / {leechers}")),
|
||||
)
|
||||
};
|
||||
|
||||
let quality_name = quality.quality.name.clone();
|
||||
|
||||
Row::new(vec![
|
||||
Cell::from(protocol.clone()),
|
||||
Cell::from(age),
|
||||
Cell::from(rejected_str),
|
||||
Cell::from(title.to_string()),
|
||||
Cell::from(indexer.clone()),
|
||||
Cell::from(format!("{size:.1} GB")),
|
||||
Cell::from(peers),
|
||||
Cell::from(quality_name),
|
||||
])
|
||||
.primary()
|
||||
};
|
||||
let author_release_table = ManagarrTable::new(
|
||||
Some(&mut app.data.readarr_data.author_releases),
|
||||
release_row_mapping,
|
||||
)
|
||||
.block(layout_block_top_border())
|
||||
.loading(app.is_loading || is_empty)
|
||||
.sorting(active_readarr_block == ActiveReadarrBlock::ManualAuthorSearchSortPrompt)
|
||||
.headers([
|
||||
"Source", "Age", "⛔", "Title", "Indexer", "Size", "Peers", "Quality",
|
||||
])
|
||||
.constraints([
|
||||
Constraint::Length(9),
|
||||
Constraint::Length(10),
|
||||
Constraint::Length(5),
|
||||
Constraint::Percentage(35),
|
||||
Constraint::Percentage(15),
|
||||
Constraint::Length(12),
|
||||
Constraint::Length(12),
|
||||
Constraint::Percentage(10),
|
||||
]);
|
||||
|
||||
f.render_widget(author_release_table, area);
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_manual_author_search_confirm_prompt(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let current_selection = app.data.readarr_data.author_releases.current_selection();
|
||||
let title = if current_selection.rejected {
|
||||
"Download Rejected Release"
|
||||
} else {
|
||||
"Download Release"
|
||||
};
|
||||
let prompt = if current_selection.rejected {
|
||||
format!(
|
||||
"Do you really want to download the rejected release: {}?",
|
||||
current_selection.title.text
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
"Do you want to download the release: {}?",
|
||||
current_selection.title.text
|
||||
)
|
||||
};
|
||||
|
||||
if current_selection.rejected {
|
||||
let mut lines_vec = vec![Line::from("Rejection reasons: ".primary().bold())];
|
||||
let mut rejections_spans = current_selection
|
||||
.rejections
|
||||
.clone()
|
||||
.unwrap_or_default()
|
||||
.iter()
|
||||
.map(|item| Line::from(format!("• {item}").primary().bold()))
|
||||
.collect::<Vec<Line<'_>>>();
|
||||
lines_vec.append(&mut rejections_spans);
|
||||
|
||||
let content_paragraph = Paragraph::new(lines_vec)
|
||||
.block(borderless_block())
|
||||
.wrap(Wrap { trim: false })
|
||||
.left_aligned();
|
||||
let confirmation_prompt = ConfirmationPrompt::new()
|
||||
.title(title)
|
||||
.prompt(&prompt)
|
||||
.content(content_paragraph)
|
||||
.yes_no_value(app.data.readarr_data.prompt_confirm);
|
||||
|
||||
f.render_widget(Popup::new(confirmation_prompt).size(Size::Small), f.area());
|
||||
} else {
|
||||
let confirmation_prompt = ConfirmationPrompt::new()
|
||||
.title(title)
|
||||
.prompt(&prompt)
|
||||
.yes_no_value(app.data.readarr_data.prompt_confirm);
|
||||
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::MediumPrompt),
|
||||
f.area(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use chrono::{Duration, Utc};
|
||||
use pretty_assertions::assert_eq;
|
||||
use ratatui::widgets::{Cell, Row};
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::models::readarr_models::{Book, BookStatistics};
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock,
|
||||
};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::readarr_ui::library::author_details_ui::{
|
||||
AuthorDetailsUi, decorate_book_row_with_style,
|
||||
};
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
|
||||
#[test]
|
||||
fn test_author_details_ui_accepts() {
|
||||
ActiveReadarrBlock::iter().for_each(|active_readarr_block| {
|
||||
if AUTHOR_DETAILS_BLOCKS.contains(&active_readarr_block) {
|
||||
assert!(AuthorDetailsUi::accepts(active_readarr_block.into()));
|
||||
} else {
|
||||
assert!(!AuthorDetailsUi::accepts(active_readarr_block.into()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_decorate_book_row_with_style_unmonitored() {
|
||||
let book = Book::default();
|
||||
let row = Row::new(vec![Cell::from("test".to_owned())]);
|
||||
|
||||
let style = decorate_book_row_with_style(&book, row.clone());
|
||||
|
||||
assert_eq!(style, row.unmonitored());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_decorate_book_row_with_style_downloaded_when_all_files_present() {
|
||||
let book = Book {
|
||||
monitored: true,
|
||||
statistics: Some(BookStatistics {
|
||||
book_file_count: 3,
|
||||
total_book_count: 3,
|
||||
..BookStatistics::default()
|
||||
}),
|
||||
..Book::default()
|
||||
};
|
||||
let row = Row::new(vec![Cell::from("test".to_owned())]);
|
||||
|
||||
let style = decorate_book_row_with_style(&book, row.clone());
|
||||
|
||||
assert_eq!(style, row.downloaded());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_decorate_book_row_with_style_unreleased_when_files_are_missing_and_release_date_is_future()
|
||||
{
|
||||
let book = Book {
|
||||
monitored: true,
|
||||
release_date: Some(Utc::now() + Duration::days(1)),
|
||||
statistics: Some(BookStatistics {
|
||||
book_file_count: 0,
|
||||
total_book_count: 3,
|
||||
..BookStatistics::default()
|
||||
}),
|
||||
..Book::default()
|
||||
};
|
||||
let row = Row::new(vec![Cell::from("test".to_owned())]);
|
||||
|
||||
let style = decorate_book_row_with_style(&book, row.clone());
|
||||
|
||||
assert_eq!(style, row.unreleased());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_decorate_book_row_with_style_missing_when_files_are_missing_and_release_date_has_passed()
|
||||
{
|
||||
let book = Book {
|
||||
monitored: true,
|
||||
release_date: Some(Utc::now() - Duration::days(1)),
|
||||
statistics: Some(BookStatistics {
|
||||
book_file_count: 1,
|
||||
total_book_count: 3,
|
||||
..BookStatistics::default()
|
||||
}),
|
||||
..Book::default()
|
||||
};
|
||||
let row = Row::new(vec![Cell::from("test".to_owned())]);
|
||||
|
||||
let style = decorate_book_row_with_style(&book, row.clone());
|
||||
|
||||
assert_eq!(style, row.missing());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_decorate_book_row_with_style_missing_when_files_are_missing_and_no_release_date() {
|
||||
let book = Book {
|
||||
monitored: true,
|
||||
release_date: None,
|
||||
statistics: Some(BookStatistics {
|
||||
book_file_count: 1,
|
||||
total_book_count: 3,
|
||||
..BookStatistics::default()
|
||||
}),
|
||||
..Book::default()
|
||||
};
|
||||
let row = Row::new(vec![Cell::from("test".to_owned())]);
|
||||
|
||||
let style = decorate_book_row_with_style(&book, row.clone());
|
||||
|
||||
assert_eq!(style, row.missing());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_decorate_book_row_with_style_missing_when_total_book_count_is_zero() {
|
||||
let book = Book {
|
||||
monitored: true,
|
||||
release_date: Some(Utc::now() - Duration::days(1)),
|
||||
statistics: Some(BookStatistics::default()),
|
||||
..Book::default()
|
||||
};
|
||||
let row = Row::new(vec![Cell::from("test".to_owned())]);
|
||||
|
||||
let style = decorate_book_row_with_style(&book, row.clone());
|
||||
|
||||
assert_eq!(style, row.missing());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_decorate_book_row_with_style_indeterminate_when_no_statistics() {
|
||||
let book = Book {
|
||||
monitored: true,
|
||||
statistics: None,
|
||||
..Book::default()
|
||||
};
|
||||
let row = Row::new(vec![Cell::from("test".to_owned())]);
|
||||
|
||||
let style = decorate_book_row_with_style(&book, row.clone());
|
||||
|
||||
assert_eq!(style, row.indeterminate());
|
||||
}
|
||||
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::readarr_models::{AuthorStatistics, BookStatistics};
|
||||
use crate::models::servarr_data::readarr::readarr_data::ActiveReadarrBlock;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::readarr_ui::library::author_details_ui::AuthorDetailsUi;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[rstest]
|
||||
#[case(ActiveReadarrBlock::AuthorDetails, 0)]
|
||||
#[case(ActiveReadarrBlock::AuthorHistory, 1)]
|
||||
#[case(ActiveReadarrBlock::ManualAuthorSearch, 2)]
|
||||
#[case(ActiveReadarrBlock::SearchBooks, 0)]
|
||||
#[case(ActiveReadarrBlock::SearchBooksError, 0)]
|
||||
#[case(ActiveReadarrBlock::UpdateAndScanAuthorPrompt, 0)]
|
||||
#[case(ActiveReadarrBlock::UpdateAndScanAuthorPrompt, 1)]
|
||||
#[case(ActiveReadarrBlock::UpdateAndScanAuthorPrompt, 2)]
|
||||
#[case(ActiveReadarrBlock::AutomaticallySearchAuthorPrompt, 0)]
|
||||
#[case(ActiveReadarrBlock::AutomaticallySearchAuthorPrompt, 1)]
|
||||
#[case(ActiveReadarrBlock::AutomaticallySearchAuthorPrompt, 2)]
|
||||
#[case(ActiveReadarrBlock::SearchAuthorHistory, 1)]
|
||||
#[case(ActiveReadarrBlock::SearchAuthorHistoryError, 1)]
|
||||
#[case(ActiveReadarrBlock::FilterAuthorHistory, 1)]
|
||||
#[case(ActiveReadarrBlock::FilterAuthorHistoryError, 1)]
|
||||
#[case(ActiveReadarrBlock::AuthorHistorySortPrompt, 1)]
|
||||
#[case(ActiveReadarrBlock::AuthorHistoryDetails, 1)]
|
||||
#[case(ActiveReadarrBlock::ManualAuthorSearchConfirmPrompt, 2)]
|
||||
#[case(ActiveReadarrBlock::ManualAuthorSearchSortPrompt, 2)]
|
||||
fn test_author_details_ui_renders(
|
||||
#[case] active_readarr_block: ActiveReadarrBlock,
|
||||
#[case] index: usize,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_readarr_block.into());
|
||||
app.data.readarr_data.author_info_tabs.set_index(index);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
AuthorDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(
|
||||
format!("author_details_{active_readarr_block}_{index}"),
|
||||
output
|
||||
);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case(ActiveReadarrBlock::AuthorDetails, 0)]
|
||||
#[case(ActiveReadarrBlock::AuthorHistory, 1)]
|
||||
#[case(ActiveReadarrBlock::ManualAuthorSearch, 2)]
|
||||
fn test_author_details_ui_renders_author_details_loading(
|
||||
#[case] active_readarr_block: ActiveReadarrBlock,
|
||||
#[case] index: usize,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_readarr_block.into());
|
||||
app.data.readarr_data.author_info_tabs.set_index(index);
|
||||
app.is_loading = true;
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
AuthorDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(
|
||||
format!("loading_author_details_{active_readarr_block}"),
|
||||
output
|
||||
);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case(ActiveReadarrBlock::AuthorDetails, 0)]
|
||||
#[case(ActiveReadarrBlock::AuthorHistory, 1)]
|
||||
#[case(ActiveReadarrBlock::AuthorHistoryDetails, 1)]
|
||||
#[case(ActiveReadarrBlock::ManualAuthorSearch, 2)]
|
||||
fn test_author_details_ui_renders_author_details_empty(
|
||||
#[case] active_readarr_block: ActiveReadarrBlock,
|
||||
#[case] index: usize,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.readarr_data.books = StatefulTable::default();
|
||||
app.data.readarr_data.author_releases = StatefulTable::default();
|
||||
app.data.readarr_data.author_history = StatefulTable::default();
|
||||
app.push_navigation_stack(active_readarr_block.into());
|
||||
app.data.readarr_data.author_info_tabs.set_index(index);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
AuthorDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(
|
||||
format!("empty_author_details_{active_readarr_block}"),
|
||||
output
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_author_details_ui_renders_update_and_scan_prompt_over_author_details() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveReadarrBlock::AuthorDetails.into());
|
||||
app.push_navigation_stack(ActiveReadarrBlock::UpdateAndScanAuthorPrompt.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
AuthorDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_author_details_ui_renders_automatic_search_prompt_over_author_details() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveReadarrBlock::AuthorDetails.into());
|
||||
app.push_navigation_stack(ActiveReadarrBlock::AutomaticallySearchAuthorPrompt.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
AuthorDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_author_details_ui_renders_statistics() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
let mut author = app.data.readarr_data.authors.current_selection().clone();
|
||||
author.statistics = Some(AuthorStatistics {
|
||||
book_count: 3,
|
||||
book_file_count: 2,
|
||||
total_book_count: 3,
|
||||
available_book_count: 2,
|
||||
size_on_disk: 3543348019,
|
||||
percent_of_books: 66.6,
|
||||
});
|
||||
app.data.readarr_data.authors.set_items(vec![author]);
|
||||
let mut book = app.data.readarr_data.books.current_selection().clone();
|
||||
book.statistics = Some(BookStatistics {
|
||||
book_file_count: 1,
|
||||
total_book_count: 1,
|
||||
size_on_disk: 1771674009,
|
||||
percent_of_books: 100.0,
|
||||
});
|
||||
app.data.readarr_data.books.set_items(vec![book]);
|
||||
app.push_navigation_stack(ActiveReadarrBlock::AuthorDetails.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
AuthorDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@ mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::models::readarr_models::{Author, AuthorStatistics, AuthorStatus};
|
||||
use crate::models::servarr_data::readarr::readarr_data::{ActiveReadarrBlock, LIBRARY_BLOCKS};
|
||||
use crate::models::servarr_data::readarr::readarr_data::{
|
||||
AUTHOR_DETAILS_BLOCKS, ActiveReadarrBlock, LIBRARY_BLOCKS,
|
||||
};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::readarr_ui::library::{LibraryUi, decorate_author_row_with_style};
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
@@ -12,8 +14,11 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_library_ui_accepts() {
|
||||
let mut blocks = LIBRARY_BLOCKS.to_vec();
|
||||
blocks.extend(AUTHOR_DETAILS_BLOCKS);
|
||||
|
||||
for active_readarr_block in ActiveReadarrBlock::iter() {
|
||||
if LIBRARY_BLOCKS.contains(&active_readarr_block) {
|
||||
if blocks.contains(&active_readarr_block) {
|
||||
assert!(
|
||||
LibraryUi::accepts(active_readarr_block.into()),
|
||||
"{active_readarr_block} is not accepted by the LibraryUi"
|
||||
@@ -231,5 +236,18 @@ mod tests {
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_library_ui_renders_author_details_over_library() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveReadarrBlock::Authors.into());
|
||||
app.push_navigation_stack(ActiveReadarrBlock::AuthorDetails.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,3 +1,4 @@
|
||||
use author_details_ui::AuthorDetailsUi;
|
||||
use ratatui::{
|
||||
Frame,
|
||||
layout::{Constraint, Rect},
|
||||
@@ -20,6 +21,8 @@ use crate::{
|
||||
},
|
||||
};
|
||||
|
||||
mod author_details_ui;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "library_ui_tests.rs"]
|
||||
mod library_ui_tests;
|
||||
@@ -29,14 +32,20 @@ pub(super) struct LibraryUi;
|
||||
impl DrawUi for LibraryUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
if let Route::Readarr(active_readarr_block, _) = route {
|
||||
return LIBRARY_BLOCKS.contains(&active_readarr_block);
|
||||
return AuthorDetailsUi::accepts(route) || LIBRARY_BLOCKS.contains(&active_readarr_block);
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
let route = app.get_current_route();
|
||||
draw_library(f, app, area);
|
||||
|
||||
match route {
|
||||
_ if AuthorDetailsUi::accepts(route) => AuthorDetailsUi::draw(f, app, area),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 0/0 2023-05-20 0.00 GB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ─────────────╭─────────────────────────────────── Details ───────────────────────────────────╮───────────────────────────────╮│
|
||||
││ Books │ History │ Author Searc│Source Title: Test Source Title │ ││
|
||||
││───────────────────────────────│Event Type: grabbed │───────────────────────────────││
|
||||
││ Source Title ▼ │Quality: EPUB │ ││
|
||||
││=> Test Source Title │Date: 2023-05-20 21:29:16 UTC │-05-20 21:29:16 UTC ││
|
||||
││ │Indexer: │ ││
|
||||
││ │NZB Info URL: │ ││
|
||||
││ │Release Group: │ ││
|
||||
││ │Age: 0 days │ ││
|
||||
││ │Published Date: 1970-01-01 00:00:00 UTC │ ││
|
||||
││ │Download Client: │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title Event Type Quality Date ││
|
||||
││=> Test Source Title grabbed EPUB 2023-05-20 21:29:16 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭───────────────────────────╮ ││
|
||||
││ │Something │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰───────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test Source Title grabbed EPUB 2023-05-20 21:29:16 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────╭──────────────── Automatic Author Search ────────────────╮───────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
|
||||
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 0.00 GB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────╭──────────────── Automatic Author Search ────────────────╮───────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
|
||||
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
|
||||
││ Source Title ▼ │ │ Date ││
|
||||
││=> Test Source Title │ │ 2023-05-20 21:29:16 UTC ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────╭──────────────── Automatic Author Search ────────────────╮───────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
|
||||
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
|
||||
││ Source ▼ Age ⛔ Title │ │ Size Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torren│ │ 0.0 GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet│ │ 0.0 GB EPUB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test Source Title grabbed EPUB 2023-05-20 21:29:16 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭──────────── Error ─────────────╮ ││
|
||||
││ │ The given filter produced empty │ ││
|
||||
││ ╰──────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test Source Title grabbed EPUB 2023-05-20 21:29:16 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭────────────── Filter ───────────────╮ ││
|
||||
││ │author history filter │ ││
|
||||
││ ╰───────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───────────────── Download Rejected Release ──────────────────╮ │
|
||||
│╭ Author Details ──────────────────────│ Do you really want to download the rejected release: Test │───────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │ Torrent Release? │ ││
|
||||
││────────────────────────────────────────│ │───────────────────────────────────────││
|
||||
││ Source ▼ Age ⛔ Title │ │e Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torre│Rejection reasons: │ GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usene│• Unknown quality profile │ GB EPUB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭──────────────────────────────╮╭──────────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰──────────────────────────────╯╰──────────────────────────────╯│ ││
|
||||
││ ╰────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Age ⛔ Title Indexer Size Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 GB EPUB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭───────────────────────────╮ ││
|
||||
││ │Something │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰───────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source ▼ Age ⛔ Title Indexer Size Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torrent Release kickass torrents 0.0 GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet Release DrunkenSlug 0.0 GB EPUB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test Source Title grabbed EPUB 2023-05-20 21:29:16 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭──────────── Error ─────────────╮ ││
|
||||
││ │ No items found matching search │ ││
|
||||
││ ╰──────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test Source Title grabbed EPUB 2023-05-20 21:29:16 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭────────────── Search ───────────────╮ ││
|
||||
││ │author history search │ ││
|
||||
││ ╰───────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 0/0 2023-05-20 0.00 GB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭──────────── Error ─────────────╮ ││
|
||||
││ │ No items found matching search │ ││
|
||||
││ ╰──────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 0/0 2023-05-20 0.00 GB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭────────────── Search ───────────────╮ ││
|
||||
││ │book search │ ││
|
||||
││ ╰───────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────╭──────────────────── Update and Scan ────────────────────╮───────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
|
||||
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 0.00 GB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────╭──────────────────── Update and Scan ────────────────────╮───────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
|
||||
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
|
||||
││ Source Title ▼ │ │ Date ││
|
||||
││=> Test Source Title │ │ 2023-05-20 21:29:16 UTC ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────╭──────────────────── Update and Scan ────────────────────╮───────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
|
||||
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
|
||||
││ Source ▼ Age ⛔ Title │ │ Size Peers Quality ││
|
||||
││=> torrent 1 days ⛔ Test Torren│ │ 0.0 GB 2 / 1 EPUB ││
|
||||
││ usenet 1 days ⛔ Test Usenet│ │ 0.0 GB EPUB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────╭──────────────── Automatic Author Search ────────────────╮───────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
|
||||
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 0.00 GB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Books: 3 │
|
||||
│Files: 2/3 │
|
||||
│Size on Disk: 3.30 GB │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 1/1 2023-05-20 1.65 GB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────╭──────────────────── Update and Scan ────────────────────╮───────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
|
||||
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │Date Size ││
|
||||
││=> 🏷 Test Book │ │20 0.00 GB ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ─────────────╭─────────────────────────────────── Details ───────────────────────────────────╮───────────────────────────────╮│
|
||||
││ Books │ History │ Author Searc│Source Title: │ ││
|
||||
││───────────────────────────────│Event Type: unknown │───────────────────────────────││
|
||||
││ │Quality: │ ││
|
||||
││ │Date: 1970-01-01 00:00:00 UTC │ ││
|
||||
││ │No additional details available. │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
││ Loading ... ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
││ Loading ... ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
││ Loading ... ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/author_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
││ Loading ... ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/library_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Type Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Standard 0 0.00 GB 🏷 alex
|
||||
╭ Test Author ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Author: Test Author │
|
||||
│Overview: some interesting description of the author │
|
||||
│Status: Continuing │
|
||||
│Genres: science fiction │
|
||||
│Rating: N/A │
|
||||
│Path: /nfs/books/Test Author │
|
||||
│Quality Profile: Standard │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Author Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Books │ History │ Author Search ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Files Release Date Size ││
|
||||
││=> 🏷 Test Book 0/0 2023-05-20 0.00 GB ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
@@ -35,6 +35,7 @@ use crate::{
|
||||
};
|
||||
|
||||
mod library;
|
||||
mod readarr_ui_utils;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "readarr_ui_tests.rs"]
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
use crate::models::readarr_models::{
|
||||
ReadarrHistoryData, ReadarrHistoryEventType, ReadarrHistoryItem,
|
||||
};
|
||||
use ratatui::text::Line;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "readarr_ui_utils_tests.rs"]
|
||||
mod readarr_ui_utils_tests;
|
||||
|
||||
pub(super) fn create_history_event_details(history_item: ReadarrHistoryItem) -> Vec<Line<'static>> {
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item;
|
||||
let ReadarrHistoryData {
|
||||
indexer,
|
||||
nzb_info_url,
|
||||
release_group,
|
||||
age,
|
||||
published_date,
|
||||
download_client_name,
|
||||
download_client,
|
||||
message,
|
||||
reason,
|
||||
dropped_path,
|
||||
imported_path,
|
||||
source_path,
|
||||
path,
|
||||
status_messages,
|
||||
} = data;
|
||||
|
||||
let mut lines = vec![
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start())),
|
||||
Line::from(format!("Event Type: {event_type}")),
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start())),
|
||||
Line::from(format!("Date: {date}")),
|
||||
];
|
||||
|
||||
match event_type {
|
||||
ReadarrHistoryEventType::Grabbed => {
|
||||
lines.push(Line::from(format!(
|
||||
"Indexer: {}",
|
||||
indexer.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"NZB Info URL: {}",
|
||||
nzb_info_url.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Release Group: {}",
|
||||
release_group.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Age: {} days",
|
||||
age.unwrap_or("0".to_owned()).trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Published Date: {}",
|
||||
published_date.unwrap_or_default()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Download Client: {}",
|
||||
download_client_name
|
||||
.unwrap_or(download_client.unwrap_or_default())
|
||||
.trim_start()
|
||||
)));
|
||||
}
|
||||
ReadarrHistoryEventType::DownloadImported => {
|
||||
lines.push(Line::from(format!(
|
||||
"Release Group: {}",
|
||||
release_group.unwrap_or_default().trim_start()
|
||||
)));
|
||||
}
|
||||
ReadarrHistoryEventType::DownloadFailed => {
|
||||
lines.push(Line::from(format!(
|
||||
"Download Client: {}",
|
||||
download_client_name
|
||||
.unwrap_or(download_client.unwrap_or_default())
|
||||
.trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Message: {}",
|
||||
message.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Release Group: {}",
|
||||
release_group.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Indexer: {}",
|
||||
indexer.unwrap_or_default().trim_start()
|
||||
)));
|
||||
}
|
||||
ReadarrHistoryEventType::BookFileDeleted => {
|
||||
lines.push(Line::from(format!(
|
||||
"Reason: {}",
|
||||
reason.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Release Group: {}",
|
||||
release_group.unwrap_or_default().trim_start()
|
||||
)));
|
||||
}
|
||||
ReadarrHistoryEventType::BookFileImported => {
|
||||
lines.push(Line::from(format!(
|
||||
"Dropped Path: {}",
|
||||
dropped_path.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Imported Path: {}",
|
||||
imported_path.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Download Client: {}",
|
||||
download_client_name
|
||||
.unwrap_or(download_client.unwrap_or_default())
|
||||
.trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Release Group: {}",
|
||||
release_group.unwrap_or_default().trim_start()
|
||||
)));
|
||||
}
|
||||
ReadarrHistoryEventType::BookFileRenamed => {
|
||||
lines.push(Line::from(format!(
|
||||
"Source Path: {}",
|
||||
source_path.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Path: {}",
|
||||
path.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Release Group: {}",
|
||||
release_group.unwrap_or_default().trim_start()
|
||||
)));
|
||||
}
|
||||
ReadarrHistoryEventType::BookFileRetagged => {
|
||||
lines.push(Line::from(format!(
|
||||
"Release Group: {}",
|
||||
release_group.unwrap_or_default().trim_start()
|
||||
)));
|
||||
}
|
||||
ReadarrHistoryEventType::BookImportIncomplete => {
|
||||
lines.push(Line::from(format!(
|
||||
"Status Messages: {}",
|
||||
status_messages.unwrap_or_default().trim_start()
|
||||
)));
|
||||
lines.push(Line::from(format!(
|
||||
"Release Group: {}",
|
||||
release_group.unwrap_or_default().trim_start()
|
||||
)));
|
||||
}
|
||||
_ => {
|
||||
lines.push(Line::from("No additional details available.".to_owned()));
|
||||
}
|
||||
}
|
||||
|
||||
lines
|
||||
}
|
||||
@@ -0,0 +1,477 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use chrono::Utc;
|
||||
use pretty_assertions::assert_eq;
|
||||
use ratatui::text::Line;
|
||||
|
||||
use crate::models::readarr_models::{
|
||||
ReadarrHistoryData, ReadarrHistoryEventType, ReadarrHistoryItem,
|
||||
};
|
||||
use crate::models::servarr_models::{Quality, QualityWrapper};
|
||||
use crate::ui::readarr_ui::readarr_ui_utils::create_history_event_details;
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_grabbed() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::Grabbed);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(
|
||||
result[4],
|
||||
Line::from(format!("Indexer: {}", data.indexer.unwrap().trim_start()))
|
||||
);
|
||||
assert_eq!(
|
||||
result[5],
|
||||
Line::from(format!(
|
||||
"NZB Info URL: {}",
|
||||
data.nzb_info_url.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[6],
|
||||
Line::from(format!(
|
||||
"Release Group: {}",
|
||||
data.release_group.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[7],
|
||||
Line::from(format!("Age: {} days", data.age.unwrap().trim_start()))
|
||||
);
|
||||
assert_eq!(
|
||||
result[8],
|
||||
Line::from(format!("Published Date: {}", data.published_date.unwrap()))
|
||||
);
|
||||
assert_eq!(
|
||||
result[9],
|
||||
Line::from(format!(
|
||||
"Download Client: {}",
|
||||
data.download_client_name.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(result.len(), 10);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_grabbed_uses_download_client_as_fallback() {
|
||||
let mut history_item = readarr_history_item(ReadarrHistoryEventType::Grabbed);
|
||||
history_item.data.download_client_name = None;
|
||||
history_item.data.download_client = Some("\nFallback Client".to_owned());
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(result[9], Line::from("Download Client: Fallback Client"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_download_imported() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::DownloadImported);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(
|
||||
result[4],
|
||||
Line::from(format!(
|
||||
"Release Group: {}",
|
||||
data.release_group.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(result.len(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_download_failed() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::DownloadFailed);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(
|
||||
result[4],
|
||||
Line::from(format!(
|
||||
"Download Client: {}",
|
||||
data.download_client_name.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[5],
|
||||
Line::from(format!("Message: {}", data.message.unwrap().trim_start()))
|
||||
);
|
||||
assert_eq!(
|
||||
result[6],
|
||||
Line::from(format!(
|
||||
"Release Group: {}",
|
||||
data.release_group.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[7],
|
||||
Line::from(format!("Indexer: {}", data.indexer.unwrap().trim_start()))
|
||||
);
|
||||
assert_eq!(result.len(), 8);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_book_file_deleted() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::BookFileDeleted);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(
|
||||
result[4],
|
||||
Line::from(format!("Reason: {}", data.reason.unwrap().trim_start()))
|
||||
);
|
||||
assert_eq!(
|
||||
result[5],
|
||||
Line::from(format!(
|
||||
"Release Group: {}",
|
||||
data.release_group.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(result.len(), 6);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_book_file_imported() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::BookFileImported);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(
|
||||
result[4],
|
||||
Line::from(format!(
|
||||
"Dropped Path: {}",
|
||||
data.dropped_path.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[5],
|
||||
Line::from(format!(
|
||||
"Imported Path: {}",
|
||||
data.imported_path.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[6],
|
||||
Line::from(format!(
|
||||
"Download Client: {}",
|
||||
data.download_client_name.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[7],
|
||||
Line::from(format!(
|
||||
"Release Group: {}",
|
||||
data.release_group.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(result.len(), 8);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_book_file_renamed() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::BookFileRenamed);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(
|
||||
result[4],
|
||||
Line::from(format!(
|
||||
"Source Path: {}",
|
||||
data.source_path.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[5],
|
||||
Line::from(format!("Path: {}", data.path.unwrap().trim_start()))
|
||||
);
|
||||
assert_eq!(
|
||||
result[6],
|
||||
Line::from(format!(
|
||||
"Release Group: {}",
|
||||
data.release_group.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(result.len(), 7);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_book_file_retagged() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::BookFileRetagged);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(
|
||||
result[4],
|
||||
Line::from(format!(
|
||||
"Release Group: {}",
|
||||
data.release_group.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(result.len(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_book_import_incomplete() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::BookImportIncomplete);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
data,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(
|
||||
result[4],
|
||||
Line::from(format!(
|
||||
"Status Messages: {}",
|
||||
data.status_messages.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(
|
||||
result[5],
|
||||
Line::from(format!(
|
||||
"Release Group: {}",
|
||||
data.release_group.unwrap().trim_start()
|
||||
))
|
||||
);
|
||||
assert_eq!(result.len(), 6);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_unknown() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::Unknown);
|
||||
let ReadarrHistoryItem {
|
||||
source_title,
|
||||
event_type,
|
||||
quality,
|
||||
date,
|
||||
..
|
||||
} = history_item.clone();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(
|
||||
result[0],
|
||||
Line::from(format!("Source Title: {}", source_title.text.trim_start()))
|
||||
);
|
||||
assert_eq!(result[1], Line::from(format!("Event Type: {event_type}")));
|
||||
assert_eq!(
|
||||
result[2],
|
||||
Line::from(format!("Quality: {}", quality.quality.name.trim_start()))
|
||||
);
|
||||
assert_eq!(result[3], Line::from(format!("Date: {date}")));
|
||||
assert_eq!(result[4], Line::from("No additional details available."));
|
||||
assert_eq!(result.len(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_author_folder_imported_has_no_additional_details() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::AuthorFolderImported);
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(result[4], Line::from("No additional details available."));
|
||||
assert_eq!(result.len(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_download_ignored_has_no_additional_details() {
|
||||
let history_item = readarr_history_item(ReadarrHistoryEventType::DownloadIgnored);
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(result[4], Line::from("No additional details available."));
|
||||
assert_eq!(result.len(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_create_history_event_details_with_empty_optional_fields() {
|
||||
let mut history_item = readarr_history_item(ReadarrHistoryEventType::Grabbed);
|
||||
history_item.data = ReadarrHistoryData::default();
|
||||
|
||||
let result = create_history_event_details(history_item);
|
||||
|
||||
assert_eq!(result[4], Line::from("Indexer: "));
|
||||
assert_eq!(result[5], Line::from("NZB Info URL: "));
|
||||
assert_eq!(result[6], Line::from("Release Group: "));
|
||||
assert_eq!(result[7], Line::from("Age: 0 days"));
|
||||
assert!(result[8].to_string().starts_with("Published Date:"));
|
||||
assert_eq!(result[9], Line::from("Download Client: "));
|
||||
}
|
||||
|
||||
fn readarr_history_item(event_type: ReadarrHistoryEventType) -> ReadarrHistoryItem {
|
||||
ReadarrHistoryItem {
|
||||
id: 1,
|
||||
source_title: "\nTest Book - Author Name".into(),
|
||||
author_id: 10,
|
||||
book_id: 100,
|
||||
event_type,
|
||||
quality: QualityWrapper {
|
||||
quality: Quality {
|
||||
name: "\nEPUB".to_owned(),
|
||||
},
|
||||
},
|
||||
date: Utc::now(),
|
||||
data: readarr_history_data(),
|
||||
}
|
||||
}
|
||||
|
||||
fn readarr_history_data() -> ReadarrHistoryData {
|
||||
ReadarrHistoryData {
|
||||
indexer: Some("\nTest Indexer".to_owned()),
|
||||
release_group: Some("\nTest Release Group".to_owned()),
|
||||
nzb_info_url: Some("\nhttps://test.url".to_owned()),
|
||||
download_client_name: Some("\nTest Download Client".to_owned()),
|
||||
download_client: Some("\nFallback Download Client".to_owned()),
|
||||
age: Some("\n7".to_owned()),
|
||||
published_date: Some(Utc::now()),
|
||||
message: Some("\nTest failure message".to_owned()),
|
||||
reason: Some("\nTest deletion reason".to_owned()),
|
||||
dropped_path: Some("\n/downloads/completed/book".to_owned()),
|
||||
imported_path: Some("\n/books/author/book".to_owned()),
|
||||
source_path: Some("\n/books/author/old_book_name".to_owned()),
|
||||
path: Some("\n/books/author/new_book_name".to_owned()),
|
||||
status_messages: Some("\nMissing chapters: 1, 2, 3".to_owned()),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user