feat(sonarr): add a scrollable overview popup to series details
A series' overview renders as one line of a description box that does not scroll, so a long overview overflows with no way to read the rest. Pressing v on the series details Seasons tab now opens a popup holding the full overview. The popup owns its own ScrollableText, built fresh from the series' overview when it opens and torn down on Esc so a reopened popup starts at the top. Scrolling mutates only that owned state. The background paragraph renders the Series record's overview, which carries no scroll offset, so it cannot scroll along with the popup. Cite the existing view keybinding from the series details context clues and give the popup its own clue set so it does not inherit the hints of the view underneath. Enrich the shared series fixture to a multi-paragraph overview, and the raw response fixture that encodes the same series, so a scrolled popup is distinguishable from an unscrolled one.
This commit is contained in:
57 files changed
+1454
-62
No files matched your search
@@ -7,7 +7,7 @@ use crate::models::Route;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ADD_SERIES_BLOCKS, ActiveSonarrBlock, DELETE_SERIES_BLOCKS, EDIT_INDEXER_BLOCKS,
|
||||
EDIT_SERIES_BLOCKS, EPISODE_DETAILS_BLOCKS, INDEXER_SETTINGS_BLOCKS, SEASON_DETAILS_BLOCKS,
|
||||
SERIES_DETAILS_BLOCKS,
|
||||
SERIES_DETAILS_BLOCKS, SERIES_OVERVIEW_BLOCKS,
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -39,7 +39,7 @@ pub static SERIES_CONTEXT_CLUES: [ContextClue; 11] = [
|
||||
(DEFAULT_KEYBINDINGS.esc, "cancel filter"),
|
||||
];
|
||||
|
||||
pub static SERIES_DETAILS_CONTEXT_CLUES: [ContextClue; 8] = [
|
||||
pub static SERIES_DETAILS_CONTEXT_CLUES: [ContextClue; 9] = [
|
||||
(
|
||||
DEFAULT_KEYBINDINGS.refresh,
|
||||
DEFAULT_KEYBINDINGS.refresh.desc,
|
||||
@@ -56,6 +56,15 @@ pub static SERIES_DETAILS_CONTEXT_CLUES: [ContextClue; 8] = [
|
||||
DEFAULT_KEYBINDINGS.auto_search,
|
||||
DEFAULT_KEYBINDINGS.auto_search.desc,
|
||||
),
|
||||
(DEFAULT_KEYBINDINGS.view, "view overview"),
|
||||
(DEFAULT_KEYBINDINGS.esc, DEFAULT_KEYBINDINGS.esc.desc),
|
||||
];
|
||||
|
||||
pub static SERIES_OVERVIEW_CONTEXT_CLUES: [ContextClue; 2] = [
|
||||
(
|
||||
DEFAULT_KEYBINDINGS.refresh,
|
||||
DEFAULT_KEYBINDINGS.refresh.desc,
|
||||
),
|
||||
(DEFAULT_KEYBINDINGS.esc, DEFAULT_KEYBINDINGS.esc.desc),
|
||||
];
|
||||
|
||||
@@ -178,6 +187,9 @@ impl ContextClueProvider for SonarrContextClueProvider {
|
||||
.sonarr_data
|
||||
.series_info_tabs
|
||||
.get_active_route_contextual_help(),
|
||||
_ if SERIES_OVERVIEW_BLOCKS.contains(&active_sonarr_block) => {
|
||||
Some(&SERIES_OVERVIEW_CONTEXT_CLUES)
|
||||
}
|
||||
_ if SEASON_DETAILS_BLOCKS.contains(&active_sonarr_block) => app
|
||||
.data
|
||||
.sonarr_data
|
||||
|
||||
@@ -16,7 +16,7 @@ mod tests {
|
||||
ADD_SERIES_SEARCH_RESULTS_CONTEXT_CLUES, EPISODE_DETAILS_CONTEXT_CLUES,
|
||||
MANUAL_EPISODE_SEARCH_CONTEXT_CLUES, MANUAL_SEASON_SEARCH_CONTEXT_CLUES,
|
||||
SEASON_DETAILS_CONTEXT_CLUES, SEASON_HISTORY_CONTEXT_CLUES, SERIES_CONTEXT_CLUES,
|
||||
SERIES_DETAILS_CONTEXT_CLUES, SERIES_HISTORY_CONTEXT_CLUES,
|
||||
SERIES_DETAILS_CONTEXT_CLUES, SERIES_HISTORY_CONTEXT_CLUES, SERIES_OVERVIEW_CONTEXT_CLUES,
|
||||
},
|
||||
};
|
||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||
@@ -187,6 +187,10 @@ mod tests {
|
||||
DEFAULT_KEYBINDINGS.auto_search.desc
|
||||
)
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
series_details_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.view, "view overview")
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
series_details_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.esc, DEFAULT_KEYBINDINGS.esc.desc)
|
||||
@@ -194,6 +198,24 @@ mod tests {
|
||||
assert_none!(series_details_context_clues_iter.next());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_context_clues() {
|
||||
let mut series_overview_context_clues_iter = SERIES_OVERVIEW_CONTEXT_CLUES.iter();
|
||||
|
||||
assert_some_eq_x!(
|
||||
series_overview_context_clues_iter.next(),
|
||||
&(
|
||||
DEFAULT_KEYBINDINGS.refresh,
|
||||
DEFAULT_KEYBINDINGS.refresh.desc
|
||||
)
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
series_overview_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.esc, DEFAULT_KEYBINDINGS.esc.desc)
|
||||
);
|
||||
assert_none!(series_overview_context_clues_iter.next());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_season_details_context_clues() {
|
||||
let mut season_details_context_clues_iter = SEASON_DETAILS_CONTEXT_CLUES.iter();
|
||||
@@ -442,6 +464,16 @@ mod tests {
|
||||
assert_some_eq_x!(context_clues, expected_context_clues);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sonarr_context_clue_provider_series_overview_block() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
|
||||
let context_clues = SonarrContextClueProvider::get_context_clues(&mut app);
|
||||
|
||||
assert_some_eq_x!(context_clues, &SERIES_OVERVIEW_CONTEXT_CLUES);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case(0, ActiveSonarrBlock::SeasonDetails, &SEASON_DETAILS_CONTEXT_CLUES)]
|
||||
#[case(1, ActiveSonarrBlock::SeasonHistory, &SEASON_HISTORY_CONTEXT_CLUES)]
|
||||
|
||||
@@ -17,6 +17,7 @@ mod tests {
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ADD_SERIES_BLOCKS, ActiveSonarrBlock, DELETE_SERIES_BLOCKS, EDIT_SERIES_BLOCKS,
|
||||
EPISODE_DETAILS_BLOCKS, LIBRARY_BLOCKS, SEASON_DETAILS_BLOCKS, SERIES_DETAILS_BLOCKS,
|
||||
SERIES_OVERVIEW_BLOCKS,
|
||||
};
|
||||
use crate::models::sonarr_models::{Series, SeriesStatistics, SeriesStatus, SeriesType};
|
||||
use crate::test_handler_delegation;
|
||||
@@ -891,6 +892,7 @@ mod tests {
|
||||
library_handler_blocks.extend(DELETE_SERIES_BLOCKS);
|
||||
library_handler_blocks.extend(EDIT_SERIES_BLOCKS);
|
||||
library_handler_blocks.extend(SERIES_DETAILS_BLOCKS);
|
||||
library_handler_blocks.extend(SERIES_OVERVIEW_BLOCKS);
|
||||
library_handler_blocks.extend(SEASON_DETAILS_BLOCKS);
|
||||
library_handler_blocks.extend(EPISODE_DETAILS_BLOCKS);
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ mod episode_details_handler;
|
||||
mod library_handler_tests;
|
||||
mod season_details_handler;
|
||||
mod series_details_handler;
|
||||
mod series_overview_handler;
|
||||
|
||||
pub(super) struct LibraryHandler<'a, 'b> {
|
||||
key: Key,
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
use super::series_overview_handler::SeriesOverviewHandler;
|
||||
use crate::app::App;
|
||||
use crate::event::Key;
|
||||
use crate::handlers::sonarr_handlers::history::history_sorting_options;
|
||||
use crate::handlers::table_handler::{TableHandlingConfig, handle_table};
|
||||
use crate::handlers::{KeyEventHandler, handle_prompt_toggle};
|
||||
use crate::matches_key;
|
||||
use crate::models::servarr_data::sonarr::modals::SeriesOverviewModal;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, EDIT_SERIES_SELECTION_BLOCKS, SERIES_DETAILS_BLOCKS,
|
||||
};
|
||||
use crate::models::sonarr_models::{Season, SonarrHistoryItem};
|
||||
use crate::models::{BlockSelectionState, Route};
|
||||
use crate::models::{BlockSelectionState, Route, ScrollableText};
|
||||
use crate::network::sonarr_network::SonarrEvent;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -39,10 +41,36 @@ impl SeriesDetailsHandler<'_, '_> {
|
||||
fn extract_series_id(&self) -> i64 {
|
||||
self.app.data.sonarr_data.series.current_selection().id
|
||||
}
|
||||
|
||||
fn build_series_overview_modal(&mut self) {
|
||||
let overview = self
|
||||
.app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series
|
||||
.current_selection()
|
||||
.overview
|
||||
.clone()
|
||||
.unwrap_or_default();
|
||||
|
||||
self.app.data.sonarr_data.series_overview_modal = Some(SeriesOverviewModal {
|
||||
overview: ScrollableText::with_string(overview),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for SeriesDetailsHandler<'a, 'b> {
|
||||
fn handle(&mut self) {
|
||||
if SeriesOverviewHandler::accepts(self.active_sonarr_block) {
|
||||
return SeriesOverviewHandler::new(
|
||||
self.key,
|
||||
self.app,
|
||||
self.active_sonarr_block,
|
||||
self._context,
|
||||
)
|
||||
.handle();
|
||||
}
|
||||
|
||||
let season_table_handling_config =
|
||||
TableHandlingConfig::new(ActiveSonarrBlock::SeriesDetails.into())
|
||||
.searching_block(ActiveSonarrBlock::SearchSeason.into())
|
||||
@@ -85,7 +113,7 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for SeriesDetailsHandler
|
||||
}
|
||||
|
||||
fn accepts(active_block: ActiveSonarrBlock) -> bool {
|
||||
SERIES_DETAILS_BLOCKS.contains(&active_block)
|
||||
SeriesOverviewHandler::accepts(active_block) || SERIES_DETAILS_BLOCKS.contains(&active_block)
|
||||
}
|
||||
|
||||
fn ignore_special_keys(&self) -> bool {
|
||||
@@ -276,6 +304,12 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for SeriesDetailsHandler
|
||||
self.app.data.sonarr_data.selected_block =
|
||||
BlockSelectionState::new(EDIT_SERIES_SELECTION_BLOCKS);
|
||||
}
|
||||
_ if matches_key!(view, key) => {
|
||||
self.build_series_overview_modal();
|
||||
self
|
||||
.app
|
||||
.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
}
|
||||
_ if matches_key!(toggle_monitoring, key) => {
|
||||
self.app.data.sonarr_data.prompt_confirm = true;
|
||||
let (series_id, season_number) = self.extract_series_id_season_number_tuple();
|
||||
|
||||
@@ -9,11 +9,12 @@ mod tests {
|
||||
use crate::handlers::sonarr_handlers::library::series_details_handler::SeriesDetailsHandler;
|
||||
use crate::handlers::sonarr_handlers::sonarr_handler_test_utils::utils::{season, series};
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, SERIES_DETAILS_BLOCKS,
|
||||
ActiveSonarrBlock, SERIES_DETAILS_BLOCKS, SERIES_OVERVIEW_BLOCKS,
|
||||
};
|
||||
use crate::models::sonarr_models::Season;
|
||||
use crate::models::sonarr_models::SonarrHistoryItem;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::test_handler_delegation;
|
||||
use pretty_assertions::assert_eq;
|
||||
use rstest::rstest;
|
||||
use strum::IntoEnumIterator;
|
||||
@@ -313,11 +314,12 @@ mod tests {
|
||||
|
||||
mod test_handle_key_char {
|
||||
use super::*;
|
||||
use crate::handlers::sonarr_handlers::library::series_overview_handler::SeriesOverviewHandler;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::SonarrData;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::sonarr_test_utils::utils::create_test_sonarr_data;
|
||||
use crate::models::sonarr_models::{Series, SeriesType};
|
||||
use crate::network::sonarr_network::SonarrEvent;
|
||||
use crate::{assert_navigation_popped, test_edit_series_key};
|
||||
use crate::{assert_modal_present, assert_navigation_popped, test_edit_series_key};
|
||||
use pretty_assertions::{assert_eq, assert_str_eq};
|
||||
use serde_json::Number;
|
||||
use strum::IntoEnumIterator;
|
||||
@@ -355,6 +357,161 @@ mod tests {
|
||||
assert_modal_absent!(app.data.sonarr_data.edit_series_modal);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_details_view_key_opens_the_series_overview() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.sonarr_data.series_overview_modal = None;
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
|
||||
SeriesDetailsHandler::new(
|
||||
DEFAULT_KEYBINDINGS.view.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesDetails,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_navigation_pushed!(app, ActiveSonarrBlock::SeriesOverview.into());
|
||||
assert_modal_present!(app.data.sonarr_data.series_overview_modal);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_details_view_key_builds_the_overview_from_the_selected_series() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.sonarr_data.series_overview_modal = None;
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
|
||||
SeriesDetailsHandler::new(
|
||||
DEFAULT_KEYBINDINGS.view.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesDetails,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
let overview = &app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series_overview_modal
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.overview;
|
||||
assert_eq!(overview.offset, 0);
|
||||
assert_eq!(
|
||||
overview.get_text(),
|
||||
app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series
|
||||
.current_selection()
|
||||
.overview
|
||||
.clone()
|
||||
.unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_details_view_key_for_a_series_with_no_overview() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.sonarr_data.series_overview_modal = None;
|
||||
let mut series = app.data.sonarr_data.series.current_selection().clone();
|
||||
series.overview = None;
|
||||
app.data.sonarr_data.series.set_items(vec![series]);
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
|
||||
SeriesDetailsHandler::new(
|
||||
DEFAULT_KEYBINDINGS.view.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesDetails,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_navigation_pushed!(app, ActiveSonarrBlock::SeriesOverview.into());
|
||||
assert_str_eq!(
|
||||
app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series_overview_modal
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.overview
|
||||
.get_text(),
|
||||
""
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_details_view_key_reopens_the_series_overview_at_the_top() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.sonarr_data.series_overview_modal = None;
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
SeriesDetailsHandler::new(
|
||||
DEFAULT_KEYBINDINGS.view.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesDetails,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.end.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
SeriesDetailsHandler::new(
|
||||
DEFAULT_KEYBINDINGS.view.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesDetails,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_navigation_pushed!(app, ActiveSonarrBlock::SeriesOverview.into());
|
||||
assert_eq!(
|
||||
app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series_overview_modal
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.overview
|
||||
.offset,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_details_view_key_no_op_when_not_ready() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.sonarr_data.series_overview_modal = None;
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
|
||||
SeriesDetailsHandler::new(
|
||||
DEFAULT_KEYBINDINGS.view.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesDetails,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
ActiveSonarrBlock::SeriesDetails.into()
|
||||
);
|
||||
assert_modal_absent!(app.data.sonarr_data.series_overview_modal);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_toggle_monitoring_key() {
|
||||
let mut app = App::test_default();
|
||||
@@ -578,8 +735,11 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_series_details_handler_accepts() {
|
||||
let mut series_details_blocks = SERIES_DETAILS_BLOCKS.to_vec();
|
||||
series_details_blocks.extend(SERIES_OVERVIEW_BLOCKS);
|
||||
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if SERIES_DETAILS_BLOCKS.contains(&active_sonarr_block) {
|
||||
if series_details_blocks.contains(&active_sonarr_block) {
|
||||
assert!(SeriesDetailsHandler::accepts(active_sonarr_block));
|
||||
} else {
|
||||
assert!(!SeriesDetailsHandler::accepts(active_sonarr_block));
|
||||
@@ -587,6 +747,15 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_delegates_series_overview_blocks_to_series_overview_handler() {
|
||||
test_handler_delegation!(
|
||||
SeriesDetailsHandler,
|
||||
ActiveSonarrBlock::SeriesDetails,
|
||||
ActiveSonarrBlock::SeriesOverview
|
||||
);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn test_series_details_handler_ignore_special_keys(
|
||||
#[values(true, false)] ignore_special_keys_for_textbox_input: bool,
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
use crate::app::App;
|
||||
use crate::event::Key;
|
||||
use crate::handlers::KeyEventHandler;
|
||||
use crate::matches_key;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, SERIES_OVERVIEW_BLOCKS};
|
||||
use crate::models::{Route, Scrollable, ScrollableText};
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "series_overview_handler_tests.rs"]
|
||||
mod series_overview_handler_tests;
|
||||
|
||||
pub(super) struct SeriesOverviewHandler<'a, 'b> {
|
||||
key: Key,
|
||||
app: &'a mut App<'b>,
|
||||
active_sonarr_block: ActiveSonarrBlock,
|
||||
_context: Option<ActiveSonarrBlock>,
|
||||
}
|
||||
|
||||
impl SeriesOverviewHandler<'_, '_> {
|
||||
fn overview(&mut self) -> &mut ScrollableText {
|
||||
&mut self
|
||||
.app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series_overview_modal
|
||||
.as_mut()
|
||||
.expect("Series overview modal is undefined")
|
||||
.overview
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for SeriesOverviewHandler<'a, 'b> {
|
||||
fn accepts(active_block: ActiveSonarrBlock) -> bool {
|
||||
SERIES_OVERVIEW_BLOCKS.contains(&active_block)
|
||||
}
|
||||
|
||||
fn ignore_special_keys(&self) -> bool {
|
||||
self.app.ignore_special_keys_for_textbox_input
|
||||
}
|
||||
|
||||
fn new(
|
||||
key: Key,
|
||||
app: &'a mut App<'b>,
|
||||
active_block: ActiveSonarrBlock,
|
||||
_context: Option<ActiveSonarrBlock>,
|
||||
) -> SeriesOverviewHandler<'a, 'b> {
|
||||
SeriesOverviewHandler {
|
||||
key,
|
||||
app,
|
||||
active_sonarr_block: active_block,
|
||||
_context,
|
||||
}
|
||||
}
|
||||
|
||||
fn get_key(&self) -> Key {
|
||||
self.key
|
||||
}
|
||||
|
||||
fn is_ready(&self) -> bool {
|
||||
if self.app.is_loading {
|
||||
return false;
|
||||
}
|
||||
|
||||
self.app.data.sonarr_data.series_overview_modal.is_some()
|
||||
}
|
||||
|
||||
fn handle_scroll_up(&mut self) {
|
||||
self.overview().scroll_up();
|
||||
}
|
||||
|
||||
fn handle_scroll_down(&mut self) {
|
||||
self.overview().scroll_down();
|
||||
}
|
||||
|
||||
fn handle_home(&mut self) {
|
||||
self.overview().scroll_to_top();
|
||||
}
|
||||
|
||||
fn handle_end(&mut self) {
|
||||
self.overview().scroll_to_bottom();
|
||||
}
|
||||
|
||||
fn handle_delete(&mut self) {}
|
||||
|
||||
fn handle_left_right_action(&mut self) {}
|
||||
|
||||
fn handle_submit(&mut self) {}
|
||||
|
||||
fn handle_esc(&mut self) {
|
||||
self.app.pop_navigation_stack();
|
||||
self.app.data.sonarr_data.series_overview_modal = None;
|
||||
}
|
||||
|
||||
fn handle_char_key_event(&mut self) {
|
||||
if matches_key!(refresh, self.key) {
|
||||
self
|
||||
.app
|
||||
.pop_and_push_navigation_stack(self.active_sonarr_block.into());
|
||||
}
|
||||
}
|
||||
|
||||
fn app_mut(&mut self) -> &mut App<'b> {
|
||||
self.app
|
||||
}
|
||||
|
||||
fn current_route(&self) -> Route {
|
||||
self.app.get_current_route()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,393 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::app::key_binding::DEFAULT_KEYBINDINGS;
|
||||
use crate::handlers::KeyEventHandler;
|
||||
use crate::handlers::sonarr_handlers::library::series_overview_handler::SeriesOverviewHandler;
|
||||
use crate::models::ScrollableText;
|
||||
use crate::models::servarr_data::sonarr::modals::SeriesOverviewModal;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, SERIES_OVERVIEW_BLOCKS,
|
||||
};
|
||||
|
||||
mod test_handle_scroll_up_and_down {
|
||||
use super::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_scroll_up() {
|
||||
let mut app = app_with_series_overview();
|
||||
set_offset(&mut app, 2);
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.up.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_scroll_up_no_op_when_not_ready() {
|
||||
let mut app = app_with_series_overview();
|
||||
set_offset(&mut app, 2);
|
||||
app.is_loading = true;
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.up.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_scroll_down() {
|
||||
let mut app = app_with_series_overview();
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.down.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_scroll_down_no_op_when_not_ready() {
|
||||
let mut app = app_with_series_overview();
|
||||
app.is_loading = true;
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.down.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 0);
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_home_end {
|
||||
use super::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_home() {
|
||||
let mut app = app_with_series_overview();
|
||||
set_offset(&mut app, 3);
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.home.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_end() {
|
||||
let mut app = app_with_series_overview();
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.end.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_home_no_op_when_not_ready() {
|
||||
let mut app = app_with_series_overview();
|
||||
set_offset(&mut app, 3);
|
||||
app.is_loading = true;
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.home.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_end_no_op_when_not_ready() {
|
||||
let mut app = app_with_series_overview();
|
||||
app.is_loading = true;
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.end.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 0);
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_esc {
|
||||
use super::*;
|
||||
use crate::{assert_modal_absent, assert_navigation_popped};
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_esc_tears_down_the_series_overview_modal() {
|
||||
let mut app = app_with_series_overview();
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_navigation_popped!(app, ActiveSonarrBlock::SeriesDetails.into());
|
||||
assert_modal_absent!(app.data.sonarr_data.series_overview_modal);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_esc_tears_down_the_modal_even_when_loading() {
|
||||
let mut app = app_with_series_overview();
|
||||
app.is_loading = true;
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_navigation_popped!(app, ActiveSonarrBlock::SeriesDetails.into());
|
||||
assert_modal_absent!(app.data.sonarr_data.series_overview_modal);
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_key_char {
|
||||
use super::*;
|
||||
use crate::assert_navigation_pushed;
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_refresh_key() {
|
||||
let mut app = app_with_series_overview();
|
||||
app.is_routing = false;
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.refresh.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_navigation_pushed!(app, ActiveSonarrBlock::SeriesOverview.into());
|
||||
assert!(app.is_routing);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_refresh_key_no_op_when_not_ready() {
|
||||
let mut app = app_with_series_overview();
|
||||
app.is_loading = true;
|
||||
app.is_routing = false;
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.refresh.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert!(!app.is_routing);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_scrolling_the_overview_does_not_mutate_the_series_record() {
|
||||
let mut app = app_with_series_overview();
|
||||
let overview_before = app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series
|
||||
.current_selection()
|
||||
.overview
|
||||
.clone();
|
||||
|
||||
SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.down.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_eq!(overview_offset(&app), 1);
|
||||
assert_eq!(
|
||||
app.data.sonarr_data.series.current_selection().overview,
|
||||
overview_before
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_handler_accepts() {
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if SERIES_OVERVIEW_BLOCKS.contains(&active_sonarr_block) {
|
||||
assert!(
|
||||
SeriesOverviewHandler::accepts(active_sonarr_block),
|
||||
"{active_sonarr_block} is not accepted by the SeriesOverviewHandler"
|
||||
);
|
||||
} else {
|
||||
assert!(
|
||||
!SeriesOverviewHandler::accepts(active_sonarr_block),
|
||||
"{active_sonarr_block} is wrongly accepted by the SeriesOverviewHandler"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_handler_dispatches_no_network_events() {
|
||||
let mut app = app_with_series_overview();
|
||||
|
||||
for key in [
|
||||
DEFAULT_KEYBINDINGS.up.key,
|
||||
DEFAULT_KEYBINDINGS.down.key,
|
||||
DEFAULT_KEYBINDINGS.home.key,
|
||||
DEFAULT_KEYBINDINGS.end.key,
|
||||
DEFAULT_KEYBINDINGS.delete.key,
|
||||
DEFAULT_KEYBINDINGS.left.key,
|
||||
DEFAULT_KEYBINDINGS.right.key,
|
||||
DEFAULT_KEYBINDINGS.submit.key,
|
||||
DEFAULT_KEYBINDINGS.refresh.key,
|
||||
] {
|
||||
SeriesOverviewHandler::new(key, &mut app, ActiveSonarrBlock::SeriesOverview, None).handle();
|
||||
|
||||
assert_none!(app.data.sonarr_data.prompt_confirm_action);
|
||||
assert!(!app.data.sonarr_data.prompt_confirm);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_handler_is_not_ready_when_loading() {
|
||||
let mut app = app_with_series_overview();
|
||||
app.is_loading = true;
|
||||
|
||||
let handler = SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.up.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
);
|
||||
|
||||
assert!(!handler.is_ready());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_handler_is_not_ready_when_the_modal_is_absent() {
|
||||
let mut app = app_with_series_overview();
|
||||
app.data.sonarr_data.series_overview_modal = None;
|
||||
|
||||
let handler = SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.up.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
);
|
||||
|
||||
assert!(!handler.is_ready());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_handler_is_ready() {
|
||||
let mut app = app_with_series_overview();
|
||||
|
||||
let handler = SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.up.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
);
|
||||
|
||||
assert!(handler.is_ready());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_handler_ignores_special_keys_for_textbox_input() {
|
||||
let mut app = app_with_series_overview();
|
||||
app.ignore_special_keys_for_textbox_input = true;
|
||||
|
||||
let handler = SeriesOverviewHandler::new(
|
||||
DEFAULT_KEYBINDINGS.up.key,
|
||||
&mut app,
|
||||
ActiveSonarrBlock::SeriesOverview,
|
||||
None,
|
||||
);
|
||||
|
||||
assert!(handler.ignore_special_keys());
|
||||
}
|
||||
|
||||
fn app_with_series_overview() -> App<'static> {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.sonarr_data.series_overview_modal = Some(SeriesOverviewModal {
|
||||
overview: ScrollableText::with_string(
|
||||
"Blah blah blah\r\n\
|
||||
\r\n\
|
||||
It was filmed in Madison, Wisconsin: a city the crew never really left.\r\n\
|
||||
\r\n\
|
||||
The first season took seven years to finish.\r\n"
|
||||
.to_owned(),
|
||||
),
|
||||
});
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
|
||||
app
|
||||
}
|
||||
|
||||
fn overview_offset(app: &App<'_>) -> u16 {
|
||||
app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series_overview_modal
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.overview
|
||||
.offset
|
||||
}
|
||||
|
||||
fn set_offset(app: &mut App<'_>, offset: u16) {
|
||||
app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series_overview_modal
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.overview
|
||||
.offset = offset;
|
||||
}
|
||||
}
|
||||
@@ -351,7 +351,14 @@ pub(in crate::handlers::sonarr_handlers) mod utils {
|
||||
title: "Test".to_owned().into(),
|
||||
status: SeriesStatus::Continuing,
|
||||
ended: false,
|
||||
overview: Some("Blah blah blah".to_owned()),
|
||||
overview: Some(
|
||||
"Blah blah blah\r\n\
|
||||
\r\n\
|
||||
It was filmed in Madison, Wisconsin: a city the crew never really left.\r\n\
|
||||
\r\n\
|
||||
The first season took seven years to finish.\r\n"
|
||||
.to_owned(),
|
||||
),
|
||||
network: Some("HBO".to_owned()),
|
||||
seasons: Some(vec![season()]),
|
||||
year: 2022,
|
||||
|
||||
@@ -303,3 +303,9 @@ impl Default for SeasonDetailsModal {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
#[cfg_attr(test, derive(Debug))]
|
||||
pub struct SeriesOverviewModal {
|
||||
pub overview: ScrollableText,
|
||||
}
|
||||
@@ -11,7 +11,7 @@ mod tests {
|
||||
SELECTABLE_EPISODE_DETAILS_CONTEXT_CLUES,
|
||||
};
|
||||
use crate::models::servarr_data::sonarr::modals::{
|
||||
EditSeriesModal, EpisodeDetailsModal, SeasonDetailsModal,
|
||||
EditSeriesModal, EpisodeDetailsModal, SeasonDetailsModal, SeriesOverviewModal,
|
||||
};
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
||||
use crate::models::servarr_models::{Indexer, IndexerField};
|
||||
@@ -428,4 +428,11 @@ mod tests {
|
||||
None
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_modal_default() {
|
||||
let series_overview_modal = SeriesOverviewModal::default();
|
||||
|
||||
assert_is_empty!(series_overview_modal.overview);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
use super::modals::{AddSeriesModal, EditSeriesModal, SeasonDetailsModal};
|
||||
use super::modals::{AddSeriesModal, EditSeriesModal, SeasonDetailsModal, SeriesOverviewModal};
|
||||
use crate::{
|
||||
app::{
|
||||
context_clues::{
|
||||
@@ -89,6 +89,7 @@ pub struct SonarrData<'a> {
|
||||
pub series: StatefulTable<Series>,
|
||||
pub series_history: Option<StatefulTable<SonarrHistoryItem>>,
|
||||
pub series_info_tabs: TabState,
|
||||
pub series_overview_modal: Option<SeriesOverviewModal>,
|
||||
pub start_time: DateTime<Utc>,
|
||||
pub tags_map: BiMap<i64, String>,
|
||||
pub tasks: StatefulTable<SonarrTask>,
|
||||
@@ -172,6 +173,7 @@ impl<'a> Default for SonarrData<'a> {
|
||||
selected_block: BlockSelectionState::default(),
|
||||
series: StatefulTable::default(),
|
||||
series_history: None,
|
||||
series_overview_modal: None,
|
||||
start_time: DateTime::default(),
|
||||
tags_map: BiMap::default(),
|
||||
tasks: StatefulTable::default(),
|
||||
@@ -347,6 +349,10 @@ impl SonarrData<'_> {
|
||||
series_history.search = Some("series history search".into());
|
||||
series_history.filter = Some("series history filter".into());
|
||||
|
||||
let series_overview_modal = SeriesOverviewModal {
|
||||
overview: ScrollableText::with_string(series().overview.clone().unwrap_or_default()),
|
||||
};
|
||||
|
||||
let mut sonarr_data = SonarrData {
|
||||
add_list_exclusion: true,
|
||||
add_searched_series: Some(add_searched_series),
|
||||
@@ -364,6 +370,7 @@ impl SonarrData<'_> {
|
||||
quality_profile_map: quality_profile_map(),
|
||||
season_details_modal: Some(season_details_modal),
|
||||
series_history: Some(series_history),
|
||||
series_overview_modal: Some(series_overview_modal),
|
||||
start_time: DateTime::from(DateTime::parse_from_rfc3339("2023-05-20T21:29:16Z").unwrap()),
|
||||
tags_map: tags_map(),
|
||||
updates: updates(),
|
||||
@@ -503,6 +510,7 @@ pub enum ActiveSonarrBlock {
|
||||
SeriesHistory,
|
||||
SeriesHistoryDetails,
|
||||
SeriesHistorySortPrompt,
|
||||
SeriesOverview,
|
||||
SeriesSortPrompt,
|
||||
System,
|
||||
SystemLogs,
|
||||
@@ -542,6 +550,8 @@ pub static SERIES_DETAILS_BLOCKS: [ActiveSonarrBlock; 12] = [
|
||||
ActiveSonarrBlock::SeriesHistoryDetails,
|
||||
];
|
||||
|
||||
pub static SERIES_OVERVIEW_BLOCKS: [ActiveSonarrBlock; 1] = [ActiveSonarrBlock::SeriesOverview];
|
||||
|
||||
pub static SEASON_DETAILS_BLOCKS: [ActiveSonarrBlock; 15] = [
|
||||
ActiveSonarrBlock::SeasonDetails,
|
||||
ActiveSonarrBlock::SeasonHistory,
|
||||
|
||||
@@ -171,6 +171,7 @@ mod tests {
|
||||
assert_eq!(sonarr_data.selected_block, BlockSelectionState::default());
|
||||
assert_is_empty!(sonarr_data.series);
|
||||
assert_none!(sonarr_data.series_history);
|
||||
assert_none!(sonarr_data.series_overview_modal);
|
||||
assert_eq!(sonarr_data.start_time, <DateTime<Utc>>::default());
|
||||
assert_is_empty!(sonarr_data.tags_map);
|
||||
assert_is_empty!(sonarr_data.tasks);
|
||||
@@ -289,7 +290,8 @@ mod tests {
|
||||
EDIT_INDEXER_NZB_SELECTION_BLOCKS, EDIT_INDEXER_TORRENT_SELECTION_BLOCKS, EDIT_SERIES_BLOCKS,
|
||||
EDIT_SERIES_SELECTION_BLOCKS, EPISODE_DETAILS_BLOCKS, HISTORY_BLOCKS,
|
||||
INDEXER_SETTINGS_BLOCKS, INDEXER_SETTINGS_SELECTION_BLOCKS, INDEXERS_BLOCKS, LIBRARY_BLOCKS,
|
||||
ROOT_FOLDERS_BLOCKS, SEASON_DETAILS_BLOCKS, SERIES_DETAILS_BLOCKS, SYSTEM_DETAILS_BLOCKS,
|
||||
ROOT_FOLDERS_BLOCKS, SEASON_DETAILS_BLOCKS, SERIES_DETAILS_BLOCKS, SERIES_OVERVIEW_BLOCKS,
|
||||
SYSTEM_DETAILS_BLOCKS,
|
||||
};
|
||||
|
||||
#[test]
|
||||
@@ -671,6 +673,17 @@ mod tests {
|
||||
assert!(SERIES_DETAILS_BLOCKS.contains(&ActiveSonarrBlock::SeriesHistoryDetails));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_details_blocks_excludes_series_overview() {
|
||||
assert!(!SERIES_DETAILS_BLOCKS.contains(&ActiveSonarrBlock::SeriesOverview));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_blocks_contents() {
|
||||
assert_eq!(SERIES_OVERVIEW_BLOCKS.len(), 1);
|
||||
assert!(SERIES_OVERVIEW_BLOCKS.contains(&ActiveSonarrBlock::SeriesOverview));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_season_details_blocks_contents() {
|
||||
assert_eq!(SEASON_DETAILS_BLOCKS.len(), 15);
|
||||
|
||||
@@ -19,7 +19,7 @@ pub mod test_utils {
|
||||
"title": "Test",
|
||||
"status": "continuing",
|
||||
"ended": false,
|
||||
"overview": "Blah blah blah",
|
||||
"overview": "Blah blah blah\r\n\r\nIt was filmed in Madison, Wisconsin: a city the crew never really left.\r\n\r\nThe first season took seven years to finish.\r\n",
|
||||
"network": "HBO",
|
||||
"seasons": [
|
||||
{
|
||||
@@ -319,7 +319,14 @@ pub mod test_utils {
|
||||
title: "Test".to_owned().into(),
|
||||
status: SeriesStatus::Continuing,
|
||||
ended: false,
|
||||
overview: Some("Blah blah blah".to_owned()),
|
||||
overview: Some(
|
||||
"Blah blah blah\r\n\
|
||||
\r\n\
|
||||
It was filmed in Madison, Wisconsin: a city the crew never really left.\r\n\
|
||||
\r\n\
|
||||
The first season took seven years to finish.\r\n"
|
||||
.to_owned(),
|
||||
),
|
||||
network: Some("HBO".to_owned()),
|
||||
seasons: Some(vec![season()]),
|
||||
year: 2022,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
mod tests {
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ADD_SERIES_BLOCKS, ActiveSonarrBlock, DELETE_SERIES_BLOCKS, EDIT_SERIES_BLOCKS,
|
||||
EPISODE_DETAILS_BLOCKS, SEASON_DETAILS_BLOCKS, SERIES_DETAILS_BLOCKS,
|
||||
EPISODE_DETAILS_BLOCKS, SEASON_DETAILS_BLOCKS, SERIES_DETAILS_BLOCKS, SERIES_OVERVIEW_BLOCKS,
|
||||
};
|
||||
use crate::models::{
|
||||
servarr_data::sonarr::sonarr_data::LIBRARY_BLOCKS, sonarr_models::SeriesStatus,
|
||||
@@ -27,6 +27,7 @@ mod tests {
|
||||
library_ui_blocks.extend(DELETE_SERIES_BLOCKS);
|
||||
library_ui_blocks.extend(EDIT_SERIES_BLOCKS);
|
||||
library_ui_blocks.extend(SERIES_DETAILS_BLOCKS);
|
||||
library_ui_blocks.extend(SERIES_OVERVIEW_BLOCKS);
|
||||
library_ui_blocks.extend(SEASON_DETAILS_BLOCKS);
|
||||
library_ui_blocks.extend(EPISODE_DETAILS_BLOCKS);
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ mod episode_details_ui;
|
||||
#[path = "library_ui_tests.rs"]
|
||||
mod library_ui_tests;
|
||||
mod season_details_ui;
|
||||
mod series_overview_ui;
|
||||
|
||||
pub(super) struct LibraryUi;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, SERIES
|
||||
use crate::models::sonarr_models::{Season, SeasonStatistics, SonarrHistoryItem};
|
||||
use crate::ui::sonarr_ui::library::episode_details_ui::EpisodeDetailsUi;
|
||||
use crate::ui::sonarr_ui::library::season_details_ui::SeasonDetailsUi;
|
||||
use crate::ui::sonarr_ui::library::series_overview_ui::SeriesOverviewUi;
|
||||
use crate::ui::sonarr_ui::sonarr_ui_utils::create_history_event_details;
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::utils::{
|
||||
@@ -40,6 +41,7 @@ impl DrawUi for SeriesDetailsUi {
|
||||
};
|
||||
SeasonDetailsUi::accepts(route)
|
||||
|| EpisodeDetailsUi::accepts(route)
|
||||
|| SeriesOverviewUi::accepts(route)
|
||||
|| SERIES_DETAILS_BLOCKS.contains(&active_sonarr_block)
|
||||
}
|
||||
|
||||
@@ -107,6 +109,10 @@ impl DrawUi for SeriesDetailsUi {
|
||||
if SeasonDetailsUi::accepts(route) {
|
||||
SeasonDetailsUi::draw(f, app, area);
|
||||
}
|
||||
|
||||
if SeriesOverviewUi::accepts(route) {
|
||||
SeriesOverviewUi::draw(f, app, area);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ mod tests {
|
||||
use crate::app::App;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, EPISODE_DETAILS_BLOCKS, SEASON_DETAILS_BLOCKS, SERIES_DETAILS_BLOCKS,
|
||||
SERIES_OVERVIEW_BLOCKS,
|
||||
};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::sonarr_ui::library::series_details_ui::SeriesDetailsUi;
|
||||
@@ -15,6 +16,7 @@ mod tests {
|
||||
let mut blocks = SERIES_DETAILS_BLOCKS.clone().to_vec();
|
||||
blocks.extend(SEASON_DETAILS_BLOCKS);
|
||||
blocks.extend(EPISODE_DETAILS_BLOCKS);
|
||||
blocks.extend(SERIES_OVERVIEW_BLOCKS);
|
||||
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if blocks.contains(&active_sonarr_block) {
|
||||
@@ -28,6 +30,7 @@ mod tests {
|
||||
mod snapshot_tests {
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::ui_test_utils::test_utils::TerminalSize;
|
||||
use pretty_assertions::assert_str_eq;
|
||||
use rstest::rstest;
|
||||
|
||||
use super::*;
|
||||
@@ -134,5 +137,43 @@ mod tests {
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_details_ui_renders_series_overview_over_series_details() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_scrolling_the_series_overview_does_not_scroll_the_series_details_background() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesDetails.into());
|
||||
let before = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series_overview_modal
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.overview
|
||||
.offset = 3;
|
||||
|
||||
let after = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
assert_str_eq!(before, after);
|
||||
assert_contains!(before, "Overview: Blah blah blah");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
use crate::app::App;
|
||||
use crate::models::Route;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::SERIES_OVERVIEW_BLOCKS;
|
||||
use crate::models::sonarr_models::Series;
|
||||
use crate::ui::styles::{primary_style, unmonitored_style};
|
||||
use crate::ui::utils::title_block_centered;
|
||||
use crate::ui::widgets::loading_block::LoadingBlock;
|
||||
use crate::ui::widgets::popup::Size;
|
||||
use crate::ui::{DrawUi, draw_popup};
|
||||
use ratatui::Frame;
|
||||
use ratatui::layout::Rect;
|
||||
use ratatui::style::Style;
|
||||
use ratatui::text::{Line, Span, Text};
|
||||
use ratatui::widgets::{Paragraph, Wrap};
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "series_overview_ui_tests.rs"]
|
||||
mod series_overview_ui_tests;
|
||||
|
||||
pub(super) struct SeriesOverviewUi;
|
||||
|
||||
impl DrawUi for SeriesOverviewUi {
|
||||
fn accepts(route: Route) -> bool {
|
||||
let Route::Sonarr(active_sonarr_block, _) = route else {
|
||||
return false;
|
||||
};
|
||||
SERIES_OVERVIEW_BLOCKS.contains(&active_sonarr_block)
|
||||
}
|
||||
|
||||
fn draw(f: &mut Frame<'_>, app: &mut App<'_>, _area: Rect) {
|
||||
if app.data.sonarr_data.series_overview_modal.is_some() {
|
||||
let draw_series_overview_popup = |f: &mut Frame<'_>, app: &mut App<'_>, popup_area: Rect| {
|
||||
draw_series_overview(f, app, popup_area);
|
||||
};
|
||||
|
||||
draw_popup(f, app, draw_series_overview_popup, Size::Large);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_series_overview(f: &mut Frame<'_>, app: &App<'_>, area: Rect) {
|
||||
let block = title_block_centered("Overview");
|
||||
|
||||
match app.data.sonarr_data.series_overview_modal.as_ref() {
|
||||
Some(series_overview_modal) if !app.is_loading => {
|
||||
let style = if app.data.sonarr_data.series.is_empty() {
|
||||
primary_style()
|
||||
} else {
|
||||
style_from_series(app.data.sonarr_data.series.current_selection())
|
||||
};
|
||||
let overview = &series_overview_modal.overview;
|
||||
let text = Text::from(
|
||||
overview
|
||||
.items
|
||||
.iter()
|
||||
.map(|line| overview_line(line, style))
|
||||
.collect::<Vec<Line<'static>>>(),
|
||||
);
|
||||
|
||||
let paragraph = Paragraph::new(text)
|
||||
.block(block)
|
||||
.wrap(Wrap { trim: false })
|
||||
.scroll((overview.offset, 0));
|
||||
|
||||
f.render_widget(paragraph, area);
|
||||
}
|
||||
_ => f.render_widget(
|
||||
LoadingBlock::new(
|
||||
app.is_loading || app.data.sonarr_data.series_overview_modal.is_none(),
|
||||
block,
|
||||
),
|
||||
area,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
fn style_from_series(series: &Series) -> Style {
|
||||
if !series.monitored {
|
||||
return unmonitored_style();
|
||||
}
|
||||
|
||||
primary_style()
|
||||
}
|
||||
|
||||
fn overview_line(line: &str, style: Style) -> Line<'static> {
|
||||
Line::from(Span::styled(line.trim_end().to_owned(), style))
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use pretty_assertions::assert_eq;
|
||||
use ratatui::style::Modifier;
|
||||
use ratatui::text::Line;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, SERIES_OVERVIEW_BLOCKS,
|
||||
};
|
||||
use crate::models::sonarr_models::Series;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::sonarr_ui::library::series_overview_ui::{
|
||||
SeriesOverviewUi, overview_line, style_from_series,
|
||||
};
|
||||
use crate::ui::styles::{primary_style, unmonitored_style};
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_ui_accepts() {
|
||||
ActiveSonarrBlock::iter().for_each(|active_sonarr_block| {
|
||||
if SERIES_OVERVIEW_BLOCKS.contains(&active_sonarr_block) {
|
||||
assert!(SeriesOverviewUi::accepts(active_sonarr_block.into()));
|
||||
} else {
|
||||
assert!(!SeriesOverviewUi::accepts(active_sonarr_block.into()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_style_from_series_monitored() {
|
||||
let series = Series {
|
||||
monitored: true,
|
||||
..Series::default()
|
||||
};
|
||||
|
||||
let style = style_from_series(&series);
|
||||
|
||||
assert_eq!(style, primary_style());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_style_from_series_unmonitored() {
|
||||
let series = Series {
|
||||
monitored: false,
|
||||
..Series::default()
|
||||
};
|
||||
|
||||
let style = style_from_series(&series);
|
||||
|
||||
assert_eq!(style, unmonitored_style());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_overview_line_does_not_split_a_label_from_a_colon_in_the_prose() {
|
||||
let line = overview_line(
|
||||
"It was filmed in Madison, Wisconsin: a city the crew never really left.",
|
||||
primary_style(),
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
span_contents(&line),
|
||||
vec!["It was filmed in Madison, Wisconsin: a city the crew never really left."]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_overview_line_renders_the_prose_without_bolding_it() {
|
||||
let line = overview_line("Overview: a prose line", primary_style());
|
||||
|
||||
assert_eq!(line.spans.len(), 1);
|
||||
assert!(!line.spans[0].style.add_modifier.contains(Modifier::BOLD));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_overview_line_applies_the_given_style() {
|
||||
let line = overview_line("an unmonitored series", unmonitored_style());
|
||||
|
||||
assert_eq!(line.spans[0].style.fg, unmonitored_style().fg);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_overview_line_trims_a_trailing_carriage_return() {
|
||||
let line = overview_line(
|
||||
"The first season took seven years to finish.\r",
|
||||
primary_style(),
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
span_contents(&line),
|
||||
vec!["The first season took seven years to finish."]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_overview_line_renders_a_carriage_return_only_line_as_blank() {
|
||||
let line = overview_line("\r", primary_style());
|
||||
|
||||
assert_eq!(span_contents(&line), vec![""]);
|
||||
}
|
||||
|
||||
fn span_contents(line: &Line<'_>) -> Vec<String> {
|
||||
line
|
||||
.spans
|
||||
.iter()
|
||||
.map(|span| span.content.to_string())
|
||||
.collect()
|
||||
}
|
||||
|
||||
mod snapshot_tests {
|
||||
use crate::models::ScrollableText;
|
||||
use crate::models::servarr_data::sonarr::modals::SeriesOverviewModal;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::ui_test_utils::test_utils::TerminalSize;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_ui_renders() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesOverviewUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_ui_renders_loading() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesOverviewUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_ui_renders_scrolled() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
app
|
||||
.data
|
||||
.sonarr_data
|
||||
.series_overview_modal
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.overview
|
||||
.offset = 2;
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesOverviewUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_ui_renders_a_series_with_no_overview() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
app.data.sonarr_data.series_overview_modal = Some(SeriesOverviewModal {
|
||||
overview: ScrollableText::with_string(String::new()),
|
||||
});
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesOverviewUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_ui_renders_nothing_when_the_series_overview_modal_is_undefined() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
app.data.sonarr_data.series_overview_modal = None;
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesOverviewUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_series_overview_ui_renders_with_zero_series() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.sonarr_data.series = StatefulTable::default();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::SeriesOverview.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
SeriesOverviewUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
assert_contains!(output, "Blah blah blah");
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -11,9 +11,9 @@ expression: output
|
||||
╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮
|
||||
│ Blah blah blah │
|
||||
│ │
|
||||
│ It was filmed in Madison, Wisconsin: a city the crew never really left. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ The first season took seven years to finish. │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
|
||||
+3
-3
@@ -7,13 +7,13 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO ╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮ │
|
||||
│Status: Continuing │ Blah blah blah │ │
|
||||
│Genres: cool, famil│ │ │
|
||||
│Rating: 84% │ │ │
|
||||
│Rating: 84% │ It was filmed in Madison, Wisconsin: a city the crew never really left. │ │
|
||||
│Year: 2022 │ │ │
|
||||
│Runtime: 63 minutes│ │ │
|
||||
│Runtime: 63 minutes│ The first season took seven years to finish. │ │
|
||||
│Path: /nfs/tv/Test │ │ │
|
||||
│Quality Profile: Bl│ ╭───╮ │ │
|
||||
│Language Profile: E│ Monitored: │ ✔ │ │ │
|
||||
|
||||
+2
-2
@@ -11,9 +11,9 @@ expression: output
|
||||
╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮
|
||||
│ Blah blah blah │
|
||||
│ │
|
||||
│ It was filmed in Madison, Wisconsin: a city the crew never really left. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ The first season took seven years to finish. │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
|
||||
+3
-3
@@ -7,13 +7,13 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO ╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮ │
|
||||
│Status: Continuing │ Blah blah blah │ │
|
||||
│Genres: cool, famil│ │ │
|
||||
│Rating: 84% │ │ │
|
||||
│Rating: 84% │ It was filmed in Madison, Wisconsin: a city the crew never really left. │ │
|
||||
│Year: 2022 │ │ │
|
||||
│Runtime: 63 minutes│ │ │
|
||||
│Runtime: 63 minutes│ The first season took seven years to finish. │ │
|
||||
│Path: /nfs/tv/Test │ │ │
|
||||
│Quality Profile: Bl│ ╭───╮ │ │
|
||||
│Language Profile: E│ Monitored: │ ✔ │ │ │
|
||||
|
||||
+2
-2
@@ -11,9 +11,9 @@ expression: output
|
||||
╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮
|
||||
│ Blah blah blah │
|
||||
│ │
|
||||
│ It was filmed in Madison, Wisconsin: a city the crew never really left. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ The first season took seven years to finish. │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
|
||||
+3
-3
@@ -7,13 +7,13 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO ╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮ │
|
||||
│Status: Continuing │ Blah blah blah │ │
|
||||
│Genres: cool, famil│ │ │
|
||||
│Rating: 84% │ │ │
|
||||
│Rating: 84% │ It was filmed in Madison, Wisconsin: a city the crew never really left. │ │
|
||||
│Year: 2022 │ │ │
|
||||
│Runtime: 63 minutes│ │ │
|
||||
│Runtime: 63 minutes│ The first season took seven years to finish. │ │
|
||||
│Path: /nfs/tv/Test │ │ │
|
||||
│Quality Profile: Bl│ ╭───╮ │ │
|
||||
│Language Profile: E│ Monitored: │ ✔ │ │ │
|
||||
|
||||
+2
-2
@@ -11,9 +11,9 @@ expression: output
|
||||
╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮
|
||||
│ Blah blah blah │
|
||||
│ │
|
||||
│ It was filmed in Madison, Wisconsin: a city the crew never really left. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ The first season took seven years to finish. │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
|
||||
+3
-3
@@ -7,13 +7,13 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO ╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮ │
|
||||
│Status: Continuing │ Blah blah blah │ │
|
||||
│Genres: cool, famil│ │ │
|
||||
│Rating: 84% │ │ │
|
||||
│Rating: 84% │ It was filmed in Madison, Wisconsin: a city the crew never really left. │ │
|
||||
│Year: 2022 │ │ │
|
||||
│Runtime: 63 minutes│ │ │
|
||||
│Runtime: 63 minutes│ The first season took seven years to finish. │ │
|
||||
│Path: /nfs/tv/Test │ │ │
|
||||
│Quality Profile: Bl│ ╭───╮ │ │
|
||||
│Language Profile: E│ Monitored: │ ✔ │ │ │
|
||||
|
||||
+2
-2
@@ -11,9 +11,9 @@ expression: output
|
||||
╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮
|
||||
│ Blah blah blah │
|
||||
│ │
|
||||
│ It was filmed in Madison, Wisconsin: a city the crew never really left. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ The first season took seven years to finish. │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
|
||||
+3
-3
@@ -7,13 +7,13 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO ╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮ │
|
||||
│Status: Continuing │ Blah blah blah │ │
|
||||
│Genres: cool, famil│ │ │
|
||||
│Rating: 84% │ │ │
|
||||
│Rating: 84% │ It was filmed in Madison, Wisconsin: a city the crew never really left. │ │
|
||||
│Year: 2022 │ │ │
|
||||
│Runtime: 63 minutes│ │ │
|
||||
│Runtime: 63 minutes│ The first season took seven years to finish. │ │
|
||||
│Path: /nfs/tv/Test │ │ │
|
||||
│Quality Profile: Bl│ ╭───╮ │ │
|
||||
│Language Profile: E│ Monitored: │ ✔ │ │ │
|
||||
|
||||
+2
-2
@@ -11,9 +11,9 @@ expression: output
|
||||
╭───────────────────────────────────────────── Edit - Test ─────────────────────────────────────────────╮
|
||||
│ Blah blah blah │
|
||||
│ │
|
||||
│ It was filmed in Madison, Wisconsin: a city the crew never really left. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ The first season took seven years to finish. │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
=> Test 2022 HBO Continuin TV-MA Standard Bluray-1080p English 59.51 GB 🏷
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ expression: output
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blah │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HBO │
|
||||
│Status: Continuing │
|
||||
│Genres: cool, family, fun │
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/sonarr_ui/library/series_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Test ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Title: Test │
|
||||
│Overview: Blah blah blahIt was filmed in Madison, Wisconsin: a city the crew never really left.The first season took seven years to finish. │
|
||||
│Network: HB╭─────────────────────────────────────────────────────── Overview ───────────────────────────────────────────────────────╮ │
|
||||
│Status: Con│Blah blah blah │ │
|
||||
│Genres: coo│ │ │
|
||||
│Rating: 84%│It was filmed in Madison, Wisconsin: a city the crew never really left. │ │
|
||||
│Year: 2022 │ │ │
|
||||
│Runtime: 63│The first season took seven years to finish. │ │
|
||||
│Path: /nfs/│ │ │
|
||||
│Quality Pro│ │ │
|
||||
│Language Pr│ │ │
|
||||
│Monitored: │ │ │
|
||||
│Size on Dis│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│╭ Series D│ │───────────╮│
|
||||
││ Seasons ││ │ ││
|
||||
││──────────│ │───────────││
|
||||
││ Monitor│ │ ││
|
||||
││=> 🏷 │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/sonarr_ui/library/series_overview_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────────────────────────── Overview ───────────────────────────────────────────────────────╮
|
||||
│Blah blah blah │
|
||||
│ │
|
||||
│It was filmed in Madison, Wisconsin: a city the crew never really left. │
|
||||
│ │
|
||||
│The first season took seven years to finish. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/sonarr_ui/library/series_overview_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────────────────────────── Overview ───────────────────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/sonarr_ui/library/series_overview_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────────────────────────── Overview ───────────────────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ Loading ... │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
---
|
||||
source: src/ui/sonarr_ui/library/series_overview_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/sonarr_ui/library/series_overview_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────────────────────────── Overview ───────────────────────────────────────────────────────╮
|
||||
│It was filmed in Madison, Wisconsin: a city the crew never really left. │
|
||||
│ │
|
||||
│The first season took seven years to finish. │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
Reference in new issue
Block a user