feat: Added TUI and CLI support for viewing Artist history in Lidarr
This commit is contained in:
@@ -58,6 +58,24 @@ pub static ARTIST_DETAILS_CONTEXT_CLUES: [ContextClue; 8] = [
|
||||
(DEFAULT_KEYBINDINGS.esc, DEFAULT_KEYBINDINGS.esc.desc),
|
||||
];
|
||||
|
||||
pub static ARTIST_HISTORY_CONTEXT_CLUES: [ContextClue; 9] = [
|
||||
(
|
||||
DEFAULT_KEYBINDINGS.refresh,
|
||||
DEFAULT_KEYBINDINGS.refresh.desc,
|
||||
),
|
||||
(DEFAULT_KEYBINDINGS.edit, "edit artist"),
|
||||
(DEFAULT_KEYBINDINGS.submit, "details"),
|
||||
(DEFAULT_KEYBINDINGS.sort, DEFAULT_KEYBINDINGS.sort.desc),
|
||||
(DEFAULT_KEYBINDINGS.search, DEFAULT_KEYBINDINGS.search.desc),
|
||||
(DEFAULT_KEYBINDINGS.filter, DEFAULT_KEYBINDINGS.filter.desc),
|
||||
(
|
||||
DEFAULT_KEYBINDINGS.auto_search,
|
||||
DEFAULT_KEYBINDINGS.auto_search.desc,
|
||||
),
|
||||
(DEFAULT_KEYBINDINGS.update, DEFAULT_KEYBINDINGS.update.desc),
|
||||
(DEFAULT_KEYBINDINGS.esc, "cancel filter/close"),
|
||||
];
|
||||
|
||||
pub(in crate::app) struct LidarrContextClueProvider;
|
||||
|
||||
impl ContextClueProvider for LidarrContextClueProvider {
|
||||
|
||||
@@ -7,8 +7,8 @@ mod tests {
|
||||
};
|
||||
use crate::app::key_binding::DEFAULT_KEYBINDINGS;
|
||||
use crate::app::lidarr::lidarr_context_clues::{
|
||||
ADD_ARTIST_SEARCH_RESULTS_CONTEXT_CLUES, ARTIST_DETAILS_CONTEXT_CLUES, ARTISTS_CONTEXT_CLUES,
|
||||
LidarrContextClueProvider,
|
||||
ADD_ARTIST_SEARCH_RESULTS_CONTEXT_CLUES, ARTIST_DETAILS_CONTEXT_CLUES,
|
||||
ARTIST_HISTORY_CONTEXT_CLUES, ARTISTS_CONTEXT_CLUES, LidarrContextClueProvider,
|
||||
};
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::{
|
||||
ADD_ROOT_FOLDER_BLOCKS, ActiveLidarrBlock, EDIT_ARTIST_BLOCKS, EDIT_INDEXER_BLOCKS,
|
||||
@@ -145,6 +145,55 @@ mod tests {
|
||||
LidarrContextClueProvider::get_context_clues(&mut app);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_artist_history_context_clues() {
|
||||
let mut artist_history_context_clues_iter = ARTIST_HISTORY_CONTEXT_CLUES.iter();
|
||||
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(
|
||||
DEFAULT_KEYBINDINGS.refresh,
|
||||
DEFAULT_KEYBINDINGS.refresh.desc
|
||||
)
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.edit, "edit artist")
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.submit, "details")
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.sort, DEFAULT_KEYBINDINGS.sort.desc)
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.search, DEFAULT_KEYBINDINGS.search.desc)
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.filter, DEFAULT_KEYBINDINGS.filter.desc)
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(
|
||||
DEFAULT_KEYBINDINGS.auto_search,
|
||||
DEFAULT_KEYBINDINGS.auto_search.desc
|
||||
)
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.update, DEFAULT_KEYBINDINGS.update.desc)
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
artist_history_context_clues_iter.next(),
|
||||
&(DEFAULT_KEYBINDINGS.esc, "cancel filter/close")
|
||||
);
|
||||
assert_none!(artist_history_context_clues_iter.next());
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case(0, ActiveLidarrBlock::ArtistDetails, &ARTIST_DETAILS_CONTEXT_CLUES)]
|
||||
fn test_lidarr_context_clue_provider_artist_info_tabs(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::app::App;
|
||||
use crate::models::lidarr_models::Artist;
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
||||
use crate::models::servarr_models::Indexer;
|
||||
use crate::network::NetworkEvent;
|
||||
@@ -53,6 +54,30 @@ mod tests {
|
||||
assert_eq!(app.tick_count, 0);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_dispatch_by_artist_history_block() {
|
||||
let (tx, mut rx) = mpsc::channel::<NetworkEvent>(500);
|
||||
let mut app = App::test_default();
|
||||
app.data.lidarr_data.prompt_confirm = true;
|
||||
app.network_tx = Some(tx);
|
||||
app.data.lidarr_data.artists.set_items(vec![Artist {
|
||||
id: 1,
|
||||
..Artist::default()
|
||||
}]);
|
||||
|
||||
app
|
||||
.dispatch_by_lidarr_block(&ActiveLidarrBlock::ArtistHistory)
|
||||
.await;
|
||||
|
||||
assert!(app.is_loading);
|
||||
assert_eq!(
|
||||
rx.recv().await.unwrap(),
|
||||
LidarrEvent::GetArtistHistory(1).into()
|
||||
);
|
||||
assert!(!app.data.lidarr_data.prompt_confirm);
|
||||
assert_eq!(app.tick_count, 0);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_dispatch_by_downloads_block() {
|
||||
let (tx, mut rx) = mpsc::channel::<NetworkEvent>(500);
|
||||
|
||||
@@ -38,6 +38,13 @@ impl App<'_> {
|
||||
.dispatch_network_event(LidarrEvent::GetAlbums(self.extract_artist_id().await).into())
|
||||
.await;
|
||||
}
|
||||
ActiveLidarrBlock::ArtistHistory => {
|
||||
self
|
||||
.dispatch_network_event(
|
||||
LidarrEvent::GetArtistHistory(self.extract_artist_id().await).into(),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
ActiveLidarrBlock::AddArtistSearchResults => {
|
||||
self
|
||||
.dispatch_network_event(
|
||||
|
||||
@@ -27,6 +27,15 @@ pub enum LidarrListCommand {
|
||||
)]
|
||||
artist_id: i64,
|
||||
},
|
||||
#[command(about = "Fetch all history events for the artist with the given ID")]
|
||||
ArtistHistory {
|
||||
#[arg(
|
||||
long,
|
||||
help = "The Lidarr ID of the artist whose history you wish to fetch",
|
||||
required = true
|
||||
)]
|
||||
artist_id: i64,
|
||||
},
|
||||
#[command(about = "List all artists in your Lidarr library")]
|
||||
Artists,
|
||||
#[command(about = "List all active downloads in Lidarr")]
|
||||
@@ -101,6 +110,13 @@ impl<'a, 'b> CliCommandHandler<'a, 'b, LidarrListCommand> for LidarrListCommandH
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
LidarrListCommand::ArtistHistory { artist_id } => {
|
||||
let resp = self
|
||||
.network
|
||||
.handle_network_event(LidarrEvent::GetArtistHistory(artist_id).into())
|
||||
.await?;
|
||||
serde_json::to_string_pretty(&resp)?
|
||||
}
|
||||
LidarrListCommand::Artists => {
|
||||
let resp = self
|
||||
.network
|
||||
|
||||
@@ -69,6 +69,39 @@ mod tests {
|
||||
assert_eq!(album_command, expected_args);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_list_artist_history_requires_artist_id() {
|
||||
let result =
|
||||
Cli::command().try_get_matches_from(["managarr", "lidarr", "list", "artist-history"]);
|
||||
|
||||
assert_err!(&result);
|
||||
assert_eq!(
|
||||
result.unwrap_err().kind(),
|
||||
ErrorKind::MissingRequiredArgument
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_list_artist_history_success() {
|
||||
let expected_args = LidarrListCommand::ArtistHistory { artist_id: 1 };
|
||||
let result = Cli::try_parse_from([
|
||||
"managarr",
|
||||
"lidarr",
|
||||
"list",
|
||||
"artist-history",
|
||||
"--artist-id",
|
||||
"1",
|
||||
]);
|
||||
|
||||
assert_ok!(&result);
|
||||
|
||||
let Some(Command::Lidarr(LidarrCommand::List(artist_command))) = result.unwrap().command
|
||||
else {
|
||||
panic!("Unexpected command type");
|
||||
};
|
||||
assert_eq!(artist_command, expected_args);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_list_downloads_count_flag_requires_arguments() {
|
||||
let result =
|
||||
@@ -215,6 +248,32 @@ mod tests {
|
||||
assert_ok!(&result);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_handle_list_artist_history_command() {
|
||||
let expected_artist_id = 1;
|
||||
let mut mock_network = MockNetworkTrait::new();
|
||||
mock_network
|
||||
.expect_handle_network_event()
|
||||
.with(eq::<NetworkEvent>(
|
||||
LidarrEvent::GetArtistHistory(expected_artist_id).into(),
|
||||
))
|
||||
.times(1)
|
||||
.returning(|_| {
|
||||
Ok(Serdeable::Lidarr(LidarrSerdeable::Value(
|
||||
json!({"testResponse": "response"}),
|
||||
)))
|
||||
});
|
||||
let app_arc = Arc::new(Mutex::new(App::test_default()));
|
||||
let list_artist_history_command = LidarrListCommand::ArtistHistory { artist_id: 1 };
|
||||
|
||||
let result =
|
||||
LidarrListCommandHandler::with(&app_arc, list_artist_history_command, &mut mock_network)
|
||||
.handle()
|
||||
.await;
|
||||
|
||||
assert_ok!(&result);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_handle_list_downloads_command() {
|
||||
let expected_count = 1000;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
use crate::app::App;
|
||||
use crate::event::Key;
|
||||
use crate::handlers::lidarr_handlers::history::history_sorting_options;
|
||||
use crate::handlers::lidarr_handlers::library::delete_album_handler::DeleteAlbumHandler;
|
||||
use crate::handlers::table_handler::{TableHandlingConfig, handle_table};
|
||||
use crate::handlers::{KeyEventHandler, handle_prompt_toggle};
|
||||
use crate::matches_key;
|
||||
use crate::models::lidarr_models::Album;
|
||||
use crate::models::lidarr_models::{Album, LidarrHistoryItem};
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::{
|
||||
ARTIST_DETAILS_BLOCKS, ActiveLidarrBlock, DELETE_ALBUM_SELECTION_BLOCKS,
|
||||
EDIT_ARTIST_SELECTION_BLOCKS,
|
||||
@@ -41,10 +42,32 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveLidarrBlock> for ArtistDetailsHandler
|
||||
.search_error_block(ActiveLidarrBlock::SearchAlbumsError.into())
|
||||
.search_field_fn(|album: &Album| &album.title.text);
|
||||
|
||||
let artist_history_table_handling_config =
|
||||
TableHandlingConfig::new(ActiveLidarrBlock::ArtistHistory.into())
|
||||
.sorting_block(ActiveLidarrBlock::ArtistHistorySortPrompt.into())
|
||||
.sort_options(history_sorting_options())
|
||||
.searching_block(ActiveLidarrBlock::SearchArtistHistory.into())
|
||||
.search_error_block(ActiveLidarrBlock::SearchArtistHistoryError.into())
|
||||
.search_field_fn(|history_item: &LidarrHistoryItem| &history_item.source_title.text)
|
||||
.filtering_block(ActiveLidarrBlock::FilterArtistHistory.into())
|
||||
.filter_error_block(ActiveLidarrBlock::FilterArtistHistoryError.into())
|
||||
.filter_field_fn(|history_item: &LidarrHistoryItem| &history_item.source_title.text);
|
||||
|
||||
if !handle_table(
|
||||
self,
|
||||
|app| &mut app.data.lidarr_data.albums,
|
||||
albums_table_handling_config,
|
||||
) && !handle_table(
|
||||
self,
|
||||
|app| {
|
||||
app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_mut()
|
||||
.expect("Artist history is undefined")
|
||||
},
|
||||
artist_history_table_handling_config,
|
||||
) {
|
||||
match self.active_lidarr_block {
|
||||
_ if DeleteAlbumHandler::accepts(self.active_lidarr_block) => {
|
||||
@@ -83,7 +106,11 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveLidarrBlock> for ArtistDetailsHandler
|
||||
}
|
||||
|
||||
fn is_ready(&self) -> bool {
|
||||
!self.app.is_loading
|
||||
if self.active_lidarr_block == ActiveLidarrBlock::ArtistHistory {
|
||||
!self.app.is_loading && self.app.data.lidarr_data.artist_history.is_some()
|
||||
} else {
|
||||
!self.app.is_loading
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_scroll_up(&mut self) {}
|
||||
@@ -106,6 +133,31 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveLidarrBlock> for ArtistDetailsHandler
|
||||
|
||||
fn handle_left_right_action(&mut self) {
|
||||
match self.active_lidarr_block {
|
||||
ActiveLidarrBlock::ArtistDetails | ActiveLidarrBlock::ArtistHistory => match self.key {
|
||||
_ if matches_key!(left, self.key) => {
|
||||
self.app.data.lidarr_data.artist_info_tabs.previous();
|
||||
self.app.pop_and_push_navigation_stack(
|
||||
self
|
||||
.app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_info_tabs
|
||||
.get_active_route(),
|
||||
);
|
||||
}
|
||||
_ if matches_key!(right, self.key) => {
|
||||
self.app.data.lidarr_data.artist_info_tabs.next();
|
||||
self.app.pop_and_push_navigation_stack(
|
||||
self
|
||||
.app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_info_tabs
|
||||
.get_active_route(),
|
||||
);
|
||||
}
|
||||
_ => (),
|
||||
},
|
||||
ActiveLidarrBlock::UpdateAndScanArtistPrompt
|
||||
| ActiveLidarrBlock::AutomaticallySearchArtistPrompt => {
|
||||
handle_prompt_toggle(self.app, self.key);
|
||||
@@ -116,6 +168,20 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveLidarrBlock> for ArtistDetailsHandler
|
||||
|
||||
fn handle_submit(&mut self) {
|
||||
match self.active_lidarr_block {
|
||||
ActiveLidarrBlock::ArtistHistory
|
||||
if !self
|
||||
.app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_ref()
|
||||
.expect("Artist history should be Some")
|
||||
.is_empty() =>
|
||||
{
|
||||
self
|
||||
.app
|
||||
.push_navigation_stack(ActiveLidarrBlock::ArtistHistoryDetails.into());
|
||||
}
|
||||
ActiveLidarrBlock::AutomaticallySearchArtistPrompt => {
|
||||
if self.app.data.lidarr_data.prompt_confirm {
|
||||
self.app.data.lidarr_data.prompt_confirm_action = Some(
|
||||
@@ -144,6 +210,33 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveLidarrBlock> for ArtistDetailsHandler
|
||||
self.app.pop_navigation_stack();
|
||||
self.app.data.lidarr_data.prompt_confirm = false;
|
||||
}
|
||||
ActiveLidarrBlock::ArtistHistoryDetails => {
|
||||
self.app.pop_navigation_stack();
|
||||
}
|
||||
ActiveLidarrBlock::ArtistHistory => {
|
||||
if self
|
||||
.app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_ref()
|
||||
.expect("Artist history is not populated")
|
||||
.filtered_items
|
||||
.is_some()
|
||||
{
|
||||
self
|
||||
.app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_mut()
|
||||
.expect("Artist history is not populated")
|
||||
.reset_filter();
|
||||
} else {
|
||||
self.app.pop_navigation_stack();
|
||||
self.app.data.lidarr_data.reset_artist_info_tabs();
|
||||
}
|
||||
}
|
||||
ActiveLidarrBlock::ArtistDetails => {
|
||||
self.app.pop_navigation_stack();
|
||||
self.app.data.lidarr_data.reset_artist_info_tabs();
|
||||
@@ -194,6 +287,34 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveLidarrBlock> for ArtistDetailsHandler
|
||||
}
|
||||
_ => (),
|
||||
},
|
||||
ActiveLidarrBlock::ArtistHistory => match self.key {
|
||||
_ if matches_key!(refresh, key) => self
|
||||
.app
|
||||
.pop_and_push_navigation_stack(self.active_lidarr_block.into()),
|
||||
_ if matches_key!(auto_search, key) => {
|
||||
self
|
||||
.app
|
||||
.push_navigation_stack(ActiveLidarrBlock::AutomaticallySearchArtistPrompt.into());
|
||||
}
|
||||
_ if matches_key!(edit, key) => {
|
||||
self.app.push_navigation_stack(
|
||||
(
|
||||
ActiveLidarrBlock::EditArtistPrompt,
|
||||
Some(self.active_lidarr_block),
|
||||
)
|
||||
.into(),
|
||||
);
|
||||
self.app.data.lidarr_data.edit_artist_modal = Some((&self.app.data.lidarr_data).into());
|
||||
self.app.data.lidarr_data.selected_block =
|
||||
BlockSelectionState::new(EDIT_ARTIST_SELECTION_BLOCKS);
|
||||
}
|
||||
_ if matches_key!(update, key) => {
|
||||
self
|
||||
.app
|
||||
.push_navigation_stack(ActiveLidarrBlock::UpdateAndScanArtistPrompt.into());
|
||||
}
|
||||
_ => (),
|
||||
},
|
||||
ActiveLidarrBlock::AutomaticallySearchArtistPrompt => {
|
||||
if matches_key!(confirm, key) {
|
||||
self.app.data.lidarr_data.prompt_confirm = true;
|
||||
|
||||
@@ -11,6 +11,7 @@ mod tests {
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::{
|
||||
ARTIST_DETAILS_BLOCKS, ActiveLidarrBlock, DELETE_ALBUM_BLOCKS,
|
||||
};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
|
||||
mod test_handle_delete {
|
||||
use super::*;
|
||||
@@ -80,13 +81,15 @@ mod tests {
|
||||
mod test_handle_submit {
|
||||
use crate::app::App;
|
||||
use crate::app::key_binding::DEFAULT_KEYBINDINGS;
|
||||
use crate::assert_navigation_popped;
|
||||
use crate::event::Key;
|
||||
use crate::handlers::KeyEventHandler;
|
||||
use crate::handlers::lidarr_handlers::library::artist_details_handler::ArtistDetailsHandler;
|
||||
use crate::models::lidarr_models::LidarrHistoryItem;
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::network::lidarr_network::LidarrEvent;
|
||||
use crate::network::lidarr_network::lidarr_network_test_utils::test_utils::artist;
|
||||
use crate::{assert_navigation_popped, assert_navigation_pushed};
|
||||
use rstest::rstest;
|
||||
|
||||
const SUBMIT_KEY: Key = DEFAULT_KEYBINDINGS.submit.key;
|
||||
@@ -138,6 +141,46 @@ mod tests {
|
||||
assert_navigation_popped!(app, ActiveLidarrBlock::ArtistDetails.into());
|
||||
assert_none!(app.data.lidarr_data.prompt_confirm_action);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_artist_history_submit() {
|
||||
let mut app = App::test_default();
|
||||
let mut artist_history = StatefulTable::default();
|
||||
artist_history.set_items(vec![LidarrHistoryItem::default()]);
|
||||
app.data.lidarr_data.artist_history = Some(artist_history);
|
||||
|
||||
ArtistDetailsHandler::new(SUBMIT_KEY, &mut app, ActiveLidarrBlock::ArtistHistory, None)
|
||||
.handle();
|
||||
|
||||
assert_navigation_pushed!(app, ActiveLidarrBlock::ArtistHistoryDetails.into());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_artist_history_submit_no_op_when_artist_history_is_empty() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveLidarrBlock::ArtistHistory.into());
|
||||
app.data.lidarr_data.artist_history = Some(StatefulTable::default());
|
||||
|
||||
ArtistDetailsHandler::new(SUBMIT_KEY, &mut app, ActiveLidarrBlock::ArtistHistory, None)
|
||||
.handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
ActiveLidarrBlock::ArtistHistory.into()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_artist_history_submit_no_op_when_not_ready() {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveLidarrBlock::Artists.into());
|
||||
|
||||
ArtistDetailsHandler::new(SUBMIT_KEY, &mut app, ActiveLidarrBlock::ArtistHistory, None)
|
||||
.handle();
|
||||
|
||||
assert_eq!(app.get_current_route(), ActiveLidarrBlock::Artists.into());
|
||||
}
|
||||
}
|
||||
|
||||
mod test_handle_esc {
|
||||
@@ -147,11 +190,71 @@ mod tests {
|
||||
use crate::event::Key;
|
||||
use crate::handlers::KeyEventHandler;
|
||||
use crate::handlers::lidarr_handlers::library::artist_details_handler::ArtistDetailsHandler;
|
||||
use crate::models::lidarr_models::LidarrHistoryItem;
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use ratatui::widgets::TableState;
|
||||
use rstest::rstest;
|
||||
|
||||
const ESC_KEY: Key = DEFAULT_KEYBINDINGS.esc.key;
|
||||
|
||||
#[test]
|
||||
fn test_artist_history_details_block_esc() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveLidarrBlock::ArtistHistory.into());
|
||||
app.push_navigation_stack(ActiveLidarrBlock::ArtistHistoryDetails.into());
|
||||
|
||||
ArtistDetailsHandler::new(
|
||||
ESC_KEY,
|
||||
&mut app,
|
||||
ActiveLidarrBlock::ArtistHistoryDetails,
|
||||
None,
|
||||
)
|
||||
.handle();
|
||||
|
||||
assert_navigation_popped!(app, ActiveLidarrBlock::ArtistHistory.into());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_artist_history_esc_resets_filter_if_one_is_set_instead_of_closing_the_window() {
|
||||
let mut app = App::test_default();
|
||||
let artist_history = StatefulTable {
|
||||
filter: Some("Test".into()),
|
||||
filtered_items: Some(vec![LidarrHistoryItem::default()]),
|
||||
filtered_state: Some(TableState::default()),
|
||||
..StatefulTable::default()
|
||||
};
|
||||
app.data.lidarr_data.artist_history = Some(artist_history);
|
||||
app.push_navigation_stack(ActiveLidarrBlock::Artists.into());
|
||||
app.push_navigation_stack(ActiveLidarrBlock::ArtistHistory.into());
|
||||
|
||||
ArtistDetailsHandler::new(ESC_KEY, &mut app, ActiveLidarrBlock::ArtistHistory, None).handle();
|
||||
|
||||
assert_eq!(
|
||||
app.get_current_route(),
|
||||
ActiveLidarrBlock::ArtistHistory.into()
|
||||
);
|
||||
assert_none!(app.data.lidarr_data.artist_history.as_ref().unwrap().filter);
|
||||
assert_none!(
|
||||
app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.filtered_items
|
||||
);
|
||||
assert_none!(
|
||||
app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.filtered_state
|
||||
);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_esc(
|
||||
#[values(
|
||||
@@ -191,7 +294,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_edit_key(
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveLidarrBlock::ArtistDetails.into());
|
||||
@@ -209,12 +313,12 @@ mod tests {
|
||||
app,
|
||||
(
|
||||
ActiveLidarrBlock::EditArtistPrompt,
|
||||
Some(ActiveLidarrBlock::ArtistDetails)
|
||||
Some(active_lidarr_block)
|
||||
)
|
||||
.into()
|
||||
);
|
||||
assert_modal_present!(app.data.lidarr_data.edit_artist_modal);
|
||||
assert!(app.data.lidarr_data.edit_artist_modal.is_some());
|
||||
assert_some!(app.data.lidarr_data.edit_artist_modal);
|
||||
assert_eq!(
|
||||
app.data.lidarr_data.selected_block.blocks,
|
||||
EDIT_ARTIST_SELECTION_BLOCKS
|
||||
@@ -223,7 +327,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_edit_key_no_op_when_not_ready(
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
@@ -315,7 +420,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_auto_search_key(
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_lidarr_block.into());
|
||||
@@ -336,7 +442,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_auto_search_key_no_op_when_not_ready(
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.is_loading = true;
|
||||
@@ -355,7 +462,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_update_key(
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_lidarr_block.into());
|
||||
@@ -373,7 +481,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_update_key_no_op_when_not_ready(
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.is_loading = true;
|
||||
@@ -392,7 +501,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_refresh_key(
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.is_routing = false;
|
||||
@@ -413,7 +523,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
fn test_artist_details_refresh_key_no_op_when_not_ready(
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
@@ -444,7 +555,8 @@ mod tests {
|
||||
fn test_artist_details_prompt_confirm_key(
|
||||
#[case] prompt_block: ActiveLidarrBlock,
|
||||
#[case] expected_action: LidarrEvent,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails)] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[values(ActiveLidarrBlock::ArtistDetails, ActiveLidarrBlock::ArtistHistory)]
|
||||
active_lidarr_block: ActiveLidarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_lidarr_block.into());
|
||||
@@ -562,4 +674,35 @@ mod tests {
|
||||
|
||||
assert!(handler.is_ready());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_artist_details_handler_is_not_ready_when_not_loading_and_artist_history_is_none() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveLidarrBlock::Artists.into());
|
||||
|
||||
let handler = ArtistDetailsHandler::new(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
ActiveLidarrBlock::ArtistHistory,
|
||||
None,
|
||||
);
|
||||
|
||||
assert!(!handler.is_ready());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_artist_details_handler_ready_when_not_loading_and_artist_history_is_some() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveLidarrBlock::Artists.into());
|
||||
app.data.lidarr_data.artist_history = Some(StatefulTable::default());
|
||||
|
||||
let handler = ArtistDetailsHandler::new(
|
||||
DEFAULT_KEYBINDINGS.esc.key,
|
||||
&mut app,
|
||||
ActiveLidarrBlock::ArtistHistory,
|
||||
None,
|
||||
);
|
||||
|
||||
assert!(handler.is_ready());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +479,8 @@ serde_enum_from!(
|
||||
Artists(Vec<Artist>),
|
||||
DiskSpaces(Vec<DiskSpace>),
|
||||
DownloadsResponse(DownloadsResponse),
|
||||
HistoryWrapper(LidarrHistoryWrapper),
|
||||
LidarrHistoryWrapper(LidarrHistoryWrapper),
|
||||
LidarrHistoryItems(Vec<LidarrHistoryItem>),
|
||||
HostConfig(HostConfig),
|
||||
IndexerSettings(IndexerSettings),
|
||||
Indexers(Vec<Indexer>),
|
||||
|
||||
@@ -305,7 +305,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_lidarr_serdeable_from_history_wrapper() {
|
||||
fn test_lidarr_serdeable_from_lidarr_history_wrapper() {
|
||||
let history_wrapper = LidarrHistoryWrapper {
|
||||
records: vec![LidarrHistoryItem {
|
||||
id: 1,
|
||||
@@ -317,7 +317,21 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
lidarr_serdeable,
|
||||
LidarrSerdeable::HistoryWrapper(history_wrapper)
|
||||
LidarrSerdeable::LidarrHistoryWrapper(history_wrapper)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_lidarr_serdeable_from_lidarr_history_items() {
|
||||
let history_items = vec![LidarrHistoryItem {
|
||||
id: 1,
|
||||
..LidarrHistoryItem::default()
|
||||
}];
|
||||
let lidarr_serdeable: LidarrSerdeable = history_items.clone().into();
|
||||
|
||||
assert_eq!(
|
||||
lidarr_serdeable,
|
||||
LidarrSerdeable::LidarrHistoryItems(history_items)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::app::context_clues::{
|
||||
ROOT_FOLDERS_CONTEXT_CLUES, SYSTEM_CONTEXT_CLUES,
|
||||
};
|
||||
use crate::app::lidarr::lidarr_context_clues::{
|
||||
ARTIST_DETAILS_CONTEXT_CLUES, ARTISTS_CONTEXT_CLUES,
|
||||
ARTIST_DETAILS_CONTEXT_CLUES, ARTIST_HISTORY_CONTEXT_CLUES, ARTISTS_CONTEXT_CLUES,
|
||||
};
|
||||
use crate::models::lidarr_models::LidarrTask;
|
||||
use crate::models::servarr_data::modals::EditIndexerModal;
|
||||
@@ -39,6 +39,7 @@ use {
|
||||
crate::network::servarr_test_utils::indexer_test_result,
|
||||
crate::network::servarr_test_utils::queued_event,
|
||||
crate::network::sonarr_network::sonarr_network_test_utils::test_utils::updates,
|
||||
crate::sort_option,
|
||||
strum::{Display, EnumString, IntoEnumIterator},
|
||||
};
|
||||
|
||||
@@ -53,6 +54,7 @@ pub struct LidarrData<'a> {
|
||||
pub add_root_folder_modal: Option<AddRootFolderModal>,
|
||||
pub add_searched_artists: Option<StatefulTable<AddArtistSearchResult>>,
|
||||
pub albums: StatefulTable<Album>,
|
||||
pub artist_history: Option<StatefulTable<LidarrHistoryItem>>,
|
||||
pub artist_info_tabs: TabState,
|
||||
pub artists: StatefulTable<Artist>,
|
||||
pub delete_files: bool,
|
||||
@@ -90,6 +92,7 @@ impl LidarrData<'_> {
|
||||
|
||||
pub fn reset_artist_info_tabs(&mut self) {
|
||||
self.albums = StatefulTable::default();
|
||||
self.artist_history = None;
|
||||
self.artist_info_tabs.index = 0;
|
||||
}
|
||||
|
||||
@@ -134,6 +137,7 @@ impl<'a> Default for LidarrData<'a> {
|
||||
add_root_folder_modal: None,
|
||||
add_searched_artists: None,
|
||||
albums: StatefulTable::default(),
|
||||
artist_history: None,
|
||||
artists: StatefulTable::default(),
|
||||
delete_files: false,
|
||||
disk_space_vec: Vec::new(),
|
||||
@@ -197,12 +201,20 @@ impl<'a> Default for LidarrData<'a> {
|
||||
config: None,
|
||||
},
|
||||
]),
|
||||
artist_info_tabs: TabState::new(vec![TabRoute {
|
||||
title: "Albums".to_string(),
|
||||
route: ActiveLidarrBlock::ArtistDetails.into(),
|
||||
contextual_help: Some(&ARTIST_DETAILS_CONTEXT_CLUES),
|
||||
config: None,
|
||||
}]),
|
||||
artist_info_tabs: TabState::new(vec![
|
||||
TabRoute {
|
||||
title: "Albums".to_string(),
|
||||
route: ActiveLidarrBlock::ArtistDetails.into(),
|
||||
contextual_help: Some(&ARTIST_DETAILS_CONTEXT_CLUES),
|
||||
config: None,
|
||||
},
|
||||
TabRoute {
|
||||
title: "History".to_string(),
|
||||
route: ActiveLidarrBlock::ArtistHistory.into(),
|
||||
contextual_help: Some(&ARTIST_HISTORY_CONTEXT_CLUES),
|
||||
config: None,
|
||||
},
|
||||
]),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -279,7 +291,14 @@ impl LidarrData<'_> {
|
||||
let mut indexer_test_all_results = StatefulTable::default();
|
||||
indexer_test_all_results.set_items(vec![indexer_test_result()]);
|
||||
|
||||
let mut artist_history = StatefulTable::default();
|
||||
artist_history.set_items(vec![lidarr_history_item()]);
|
||||
artist_history.sorting(vec![sort_option!(id)]);
|
||||
artist_history.search = Some("artist history search".into());
|
||||
artist_history.filter = Some("artist history filter".into());
|
||||
|
||||
let mut lidarr_data = LidarrData {
|
||||
artist_history: Some(artist_history),
|
||||
delete_files: true,
|
||||
disk_space_vec: vec![diskspace()],
|
||||
quality_profile_map: quality_profile_map(),
|
||||
@@ -335,6 +354,9 @@ pub enum ActiveLidarrBlock {
|
||||
#[default]
|
||||
Artists,
|
||||
ArtistDetails,
|
||||
ArtistHistory,
|
||||
ArtistHistoryDetails,
|
||||
ArtistHistorySortPrompt,
|
||||
ArtistsSortPrompt,
|
||||
AddArtistAlreadyInLibrary,
|
||||
AddArtistConfirmPrompt,
|
||||
@@ -394,6 +416,8 @@ pub enum ActiveLidarrBlock {
|
||||
FilterArtistsError,
|
||||
FilterHistory,
|
||||
FilterHistoryError,
|
||||
FilterArtistHistory,
|
||||
FilterArtistHistoryError,
|
||||
History,
|
||||
HistoryItemDetails,
|
||||
HistorySortPrompt,
|
||||
@@ -412,6 +436,8 @@ pub enum ActiveLidarrBlock {
|
||||
SearchArtistsError,
|
||||
SearchHistory,
|
||||
SearchHistoryError,
|
||||
SearchArtistHistory,
|
||||
SearchArtistHistoryError,
|
||||
System,
|
||||
SystemLogs,
|
||||
SystemQueuedEvents,
|
||||
@@ -433,11 +459,18 @@ pub static LIBRARY_BLOCKS: [ActiveLidarrBlock; 7] = [
|
||||
ActiveLidarrBlock::UpdateAllArtistsPrompt,
|
||||
];
|
||||
|
||||
pub static ARTIST_DETAILS_BLOCKS: [ActiveLidarrBlock; 5] = [
|
||||
pub static ARTIST_DETAILS_BLOCKS: [ActiveLidarrBlock; 12] = [
|
||||
ActiveLidarrBlock::ArtistDetails,
|
||||
ActiveLidarrBlock::ArtistHistory,
|
||||
ActiveLidarrBlock::ArtistHistoryDetails,
|
||||
ActiveLidarrBlock::ArtistHistorySortPrompt,
|
||||
ActiveLidarrBlock::AutomaticallySearchArtistPrompt,
|
||||
ActiveLidarrBlock::FilterArtistHistory,
|
||||
ActiveLidarrBlock::FilterArtistHistoryError,
|
||||
ActiveLidarrBlock::SearchAlbums,
|
||||
ActiveLidarrBlock::SearchAlbumsError,
|
||||
ActiveLidarrBlock::SearchArtistHistory,
|
||||
ActiveLidarrBlock::SearchArtistHistoryError,
|
||||
ActiveLidarrBlock::UpdateAndScanArtistPrompt,
|
||||
];
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ mod tests {
|
||||
ROOT_FOLDERS_CONTEXT_CLUES, SYSTEM_CONTEXT_CLUES,
|
||||
};
|
||||
use crate::app::lidarr::lidarr_context_clues::{
|
||||
ARTIST_DETAILS_CONTEXT_CLUES, ARTISTS_CONTEXT_CLUES,
|
||||
ARTIST_DETAILS_CONTEXT_CLUES, ARTIST_HISTORY_CONTEXT_CLUES, ARTISTS_CONTEXT_CLUES,
|
||||
};
|
||||
use crate::models::lidarr_models::Album;
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::{
|
||||
@@ -16,6 +16,7 @@ mod tests {
|
||||
EDIT_INDEXER_TORRENT_SELECTION_BLOCKS, HISTORY_BLOCKS, INDEXER_SETTINGS_BLOCKS,
|
||||
INDEXER_SETTINGS_SELECTION_BLOCKS, INDEXERS_BLOCKS, ROOT_FOLDERS_BLOCKS, SYSTEM_DETAILS_BLOCKS,
|
||||
};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::models::{
|
||||
BlockSelectionState, Route,
|
||||
servarr_data::lidarr::lidarr_data::{ActiveLidarrBlock, LIBRARY_BLOCKS, LidarrData},
|
||||
@@ -59,11 +60,13 @@ mod tests {
|
||||
fn test_reset_artist_info_tabs() {
|
||||
let mut lidarr_data = LidarrData::default();
|
||||
lidarr_data.albums.set_items(vec![Album::default()]);
|
||||
lidarr_data.artist_history = Some(StatefulTable::default());
|
||||
lidarr_data.artist_info_tabs.index = 1;
|
||||
|
||||
lidarr_data.reset_artist_info_tabs();
|
||||
|
||||
assert_is_empty!(lidarr_data.albums);
|
||||
assert_none!(lidarr_data.artist_history);
|
||||
assert_eq!(lidarr_data.artist_info_tabs.index, 0);
|
||||
}
|
||||
|
||||
@@ -137,6 +140,7 @@ mod tests {
|
||||
assert_none!(lidarr_data.add_searched_artists);
|
||||
assert_is_empty!(lidarr_data.albums);
|
||||
assert_is_empty!(lidarr_data.artists);
|
||||
assert_none!(lidarr_data.artist_history);
|
||||
assert!(!lidarr_data.delete_files);
|
||||
assert_is_empty!(lidarr_data.disk_space_vec);
|
||||
assert_is_empty!(lidarr_data.downloads);
|
||||
@@ -226,7 +230,7 @@ mod tests {
|
||||
);
|
||||
assert_none!(lidarr_data.main_tabs.tabs[5].config);
|
||||
|
||||
assert_eq!(lidarr_data.artist_info_tabs.tabs.len(), 1);
|
||||
assert_eq!(lidarr_data.artist_info_tabs.tabs.len(), 2);
|
||||
assert_str_eq!(lidarr_data.artist_info_tabs.tabs[0].title, "Albums");
|
||||
assert_eq!(
|
||||
lidarr_data.artist_info_tabs.tabs[0].route,
|
||||
@@ -237,6 +241,17 @@ mod tests {
|
||||
&ARTIST_DETAILS_CONTEXT_CLUES
|
||||
);
|
||||
assert_none!(lidarr_data.artist_info_tabs.tabs[0].config);
|
||||
|
||||
assert_str_eq!(lidarr_data.artist_info_tabs.tabs[1].title, "History");
|
||||
assert_eq!(
|
||||
lidarr_data.artist_info_tabs.tabs[1].route,
|
||||
ActiveLidarrBlock::ArtistHistory.into()
|
||||
);
|
||||
assert_some_eq_x!(
|
||||
&lidarr_data.artist_info_tabs.tabs[1].contextual_help,
|
||||
&ARTIST_HISTORY_CONTEXT_CLUES
|
||||
);
|
||||
assert_none!(lidarr_data.artist_info_tabs.tabs[1].config);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -253,11 +268,18 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_artist_details_blocks_contains_expected_blocks() {
|
||||
assert_eq!(ARTIST_DETAILS_BLOCKS.len(), 5);
|
||||
assert_eq!(ARTIST_DETAILS_BLOCKS.len(), 12);
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::ArtistDetails));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::ArtistHistory));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::ArtistHistoryDetails));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::ArtistHistorySortPrompt));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::AutomaticallySearchArtistPrompt));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::FilterArtistHistory));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::FilterArtistHistoryError));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::SearchAlbums));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::SearchAlbumsError));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::SearchArtistHistory));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::SearchArtistHistoryError));
|
||||
assert!(ARTIST_DETAILS_BLOCKS.contains(&ActiveLidarrBlock::UpdateAndScanArtistPrompt));
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ use {
|
||||
crate::network::servarr_test_utils::indexer_test_result,
|
||||
crate::network::servarr_test_utils::queued_event,
|
||||
crate::network::sonarr_network::sonarr_network_test_utils::test_utils::{
|
||||
add_series_search_result, blocklist_item, download_record, history_item, indexer, log_line,
|
||||
root_folder,
|
||||
add_series_search_result, blocklist_item, download_record, indexer, log_line, root_folder,
|
||||
sonarr_history_item,
|
||||
},
|
||||
crate::network::sonarr_network::sonarr_network_test_utils::test_utils::{
|
||||
episode, episode_file, language_profiles_map, quality_profile_map, season, series, tags_map,
|
||||
@@ -309,7 +309,7 @@ impl SonarrData<'_> {
|
||||
};
|
||||
episode_details_modal
|
||||
.episode_history
|
||||
.set_items(vec![history_item()]);
|
||||
.set_items(vec![sonarr_history_item()]);
|
||||
episode_details_modal
|
||||
.episode_releases
|
||||
.set_items(vec![torrent_release(), usenet_release()]);
|
||||
@@ -328,7 +328,7 @@ impl SonarrData<'_> {
|
||||
.set_items(vec![episode_file()]);
|
||||
season_details_modal
|
||||
.season_history
|
||||
.set_items(vec![history_item()]);
|
||||
.set_items(vec![sonarr_history_item()]);
|
||||
season_details_modal.season_history.search = Some("season history search".into());
|
||||
season_details_modal.season_history.filter = Some("season history filter".into());
|
||||
season_details_modal
|
||||
@@ -342,7 +342,7 @@ impl SonarrData<'_> {
|
||||
.sorting(vec![sort_option!(indexer_id)]);
|
||||
|
||||
let mut series_history = StatefulTable::default();
|
||||
series_history.set_items(vec![history_item()]);
|
||||
series_history.set_items(vec![sonarr_history_item()]);
|
||||
series_history.sorting(vec![sort_option!(id)]);
|
||||
series_history.search = Some("series history search".into());
|
||||
series_history.filter = Some("series history filter".into());
|
||||
@@ -374,7 +374,7 @@ impl SonarrData<'_> {
|
||||
sonarr_data.blocklist.set_items(vec![blocklist_item()]);
|
||||
sonarr_data.blocklist.sorting(vec![sort_option!(id)]);
|
||||
sonarr_data.downloads.set_items(vec![download_record()]);
|
||||
sonarr_data.history.set_items(vec![history_item()]);
|
||||
sonarr_data.history.set_items(vec![sonarr_history_item()]);
|
||||
sonarr_data.history.sorting(vec![sort_option!(id)]);
|
||||
sonarr_data.history.search = Some("test search".into());
|
||||
sonarr_data.history.filter = Some("test filter".into());
|
||||
|
||||
@@ -95,7 +95,7 @@ mod tests {
|
||||
|
||||
mock.assert_async().await;
|
||||
assert!(result.is_ok());
|
||||
let LidarrSerdeable::HistoryWrapper(history) = result.unwrap() else {
|
||||
let LidarrSerdeable::LidarrHistoryWrapper(history) = result.unwrap() else {
|
||||
panic!("Expected LidarrHistoryWrapper")
|
||||
};
|
||||
assert_eq!(
|
||||
@@ -165,7 +165,7 @@ mod tests {
|
||||
app.lock().await.server_tabs.set_index(2);
|
||||
let mut network = test_network(&app);
|
||||
|
||||
let LidarrSerdeable::HistoryWrapper(history) = network
|
||||
let LidarrSerdeable::LidarrHistoryWrapper(history) = network
|
||||
.handle_lidarr_event(LidarrEvent::GetHistory(500))
|
||||
.await
|
||||
.unwrap()
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
mod tests {
|
||||
use crate::models::lidarr_models::{
|
||||
AddArtistBody, AddArtistOptions, AddArtistSearchResult, Artist, DeleteParams, EditArtistParams,
|
||||
LidarrSerdeable, MonitorType, NewItemMonitorType,
|
||||
LidarrHistoryItem, LidarrSerdeable, MonitorType, NewItemMonitorType,
|
||||
};
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
||||
use crate::models::stateful_table::{SortOption, StatefulTable};
|
||||
use crate::network::NetworkResource;
|
||||
use crate::network::lidarr_network::LidarrEvent;
|
||||
use crate::network::lidarr_network::lidarr_network_test_utils::test_utils::{
|
||||
ADD_ARTIST_SEARCH_RESULT_JSON, ARTIST_JSON,
|
||||
ADD_ARTIST_SEARCH_RESULT_JSON, ARTIST_JSON, artist, lidarr_history_item,
|
||||
};
|
||||
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
||||
use bimap::BiMap;
|
||||
use mockito::Matcher;
|
||||
use pretty_assertions::assert_eq;
|
||||
use rstest::rstest;
|
||||
use serde_json::{Value, json};
|
||||
|
||||
#[tokio::test]
|
||||
@@ -101,6 +103,296 @@ mod tests {
|
||||
assert_eq!(artist, expected_artist);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[tokio::test]
|
||||
async fn test_handle_get_lidarr_artist_history_event(
|
||||
#[values(true, false)] use_custom_sorting: bool,
|
||||
) {
|
||||
let history_json = json!([{
|
||||
"id": 123,
|
||||
"sourceTitle": "z album",
|
||||
"albumId": 1007,
|
||||
"artistId": 1007,
|
||||
"quality": { "quality": { "name": "Lossless" } },
|
||||
"date": "2023-01-01T00:00:00Z",
|
||||
"eventType": "grabbed",
|
||||
"data": {
|
||||
"droppedPath": "/nfs/nzbget/completed/music/Something/cool.mp3",
|
||||
"importedPath": "/nfs/music/Something/Album 1/Cool.mp3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 456,
|
||||
"sourceTitle": "An Album",
|
||||
"albumId": 2001,
|
||||
"artistId": 2001,
|
||||
"quality": { "quality": { "name": "Lossless" } },
|
||||
"date": "2023-01-01T00:00:00Z",
|
||||
"eventType": "grabbed",
|
||||
"data": {
|
||||
"droppedPath": "/nfs/nzbget/completed/music/Something/cool.mp3",
|
||||
"importedPath": "/nfs/music/Something/Album 1/Cool.mp3"
|
||||
}
|
||||
}]);
|
||||
let response: Vec<LidarrHistoryItem> = serde_json::from_value(history_json.clone()).unwrap();
|
||||
let mut expected_history_items = vec![
|
||||
LidarrHistoryItem {
|
||||
id: 123,
|
||||
artist_id: 1007,
|
||||
album_id: 1007,
|
||||
source_title: "z album".into(),
|
||||
..lidarr_history_item()
|
||||
},
|
||||
LidarrHistoryItem {
|
||||
id: 456,
|
||||
artist_id: 2001,
|
||||
album_id: 2001,
|
||||
source_title: "An Album".into(),
|
||||
..lidarr_history_item()
|
||||
},
|
||||
];
|
||||
let (async_server, app, _server) = MockServarrApi::get()
|
||||
.returns(history_json)
|
||||
.query("artistId=1")
|
||||
.build_for(LidarrEvent::GetArtistHistory(1))
|
||||
.await;
|
||||
let mut artist_history_table = StatefulTable {
|
||||
sort_asc: true,
|
||||
..StatefulTable::default()
|
||||
};
|
||||
if use_custom_sorting {
|
||||
let cmp_fn = |a: &LidarrHistoryItem, b: &LidarrHistoryItem| {
|
||||
a.source_title
|
||||
.text
|
||||
.to_lowercase()
|
||||
.cmp(&b.source_title.text.to_lowercase())
|
||||
};
|
||||
expected_history_items.sort_by(cmp_fn);
|
||||
|
||||
let history_sort_option = SortOption {
|
||||
name: "Source Title",
|
||||
cmp_fn: Some(cmp_fn),
|
||||
};
|
||||
artist_history_table.sorting(vec![history_sort_option]);
|
||||
}
|
||||
app
|
||||
.lock()
|
||||
.await
|
||||
.data
|
||||
.lidarr_data
|
||||
.artists
|
||||
.set_items(vec![artist()]);
|
||||
app.lock().await.data.lidarr_data.artist_history = Some(artist_history_table);
|
||||
app.lock().await.server_tabs.set_index(2);
|
||||
let mut network = test_network(&app);
|
||||
|
||||
let LidarrSerdeable::LidarrHistoryItems(history_items) = network
|
||||
.handle_lidarr_event(LidarrEvent::GetArtistHistory(1))
|
||||
.await
|
||||
.unwrap()
|
||||
else {
|
||||
panic!("Expected LidarrHistoryItems")
|
||||
};
|
||||
async_server.assert_async().await;
|
||||
let app = app.lock().await;
|
||||
assert_some!(&app.data.lidarr_data.artist_history);
|
||||
assert_eq!(
|
||||
app.data.lidarr_data.artist_history.as_ref().unwrap().items,
|
||||
expected_history_items
|
||||
);
|
||||
assert!(
|
||||
app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.sort_asc
|
||||
);
|
||||
assert_eq!(history_items, response);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_handle_get_lidarr_artist_history_event_empty_artist_history_table() {
|
||||
let history_json = json!([{
|
||||
"id": 123,
|
||||
"sourceTitle": "z album",
|
||||
"albumId": 1007,
|
||||
"artistId": 1007,
|
||||
"quality": { "quality": { "name": "Lossless" } },
|
||||
"date": "2023-01-01T00:00:00Z",
|
||||
"eventType": "grabbed",
|
||||
"data": {
|
||||
"droppedPath": "/nfs/nzbget/completed/music/Something/cool.mp3",
|
||||
"importedPath": "/nfs/music/Something/Album 1/Cool.mp3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 456,
|
||||
"sourceTitle": "An Album",
|
||||
"albumId": 2001,
|
||||
"artistId": 2001,
|
||||
"quality": { "quality": { "name": "Lossless" } },
|
||||
"date": "2023-01-01T00:00:00Z",
|
||||
"eventType": "grabbed",
|
||||
"data": {
|
||||
"droppedPath": "/nfs/nzbget/completed/music/Something/cool.mp3",
|
||||
"importedPath": "/nfs/music/Something/Album 1/Cool.mp3"
|
||||
}
|
||||
}]);
|
||||
let response: Vec<LidarrHistoryItem> = serde_json::from_value(history_json.clone()).unwrap();
|
||||
let expected_history_items = vec![
|
||||
LidarrHistoryItem {
|
||||
id: 123,
|
||||
artist_id: 1007,
|
||||
album_id: 1007,
|
||||
source_title: "z album".into(),
|
||||
..lidarr_history_item()
|
||||
},
|
||||
LidarrHistoryItem {
|
||||
id: 456,
|
||||
artist_id: 2001,
|
||||
album_id: 2001,
|
||||
source_title: "An Album".into(),
|
||||
..lidarr_history_item()
|
||||
},
|
||||
];
|
||||
let (async_server, app, _server) = MockServarrApi::get()
|
||||
.returns(history_json)
|
||||
.query("artistId=1")
|
||||
.build_for(LidarrEvent::GetArtistHistory(1))
|
||||
.await;
|
||||
app
|
||||
.lock()
|
||||
.await
|
||||
.data
|
||||
.lidarr_data
|
||||
.artists
|
||||
.set_items(vec![artist()]);
|
||||
app.lock().await.server_tabs.set_index(2);
|
||||
let mut network = test_network(&app);
|
||||
|
||||
let LidarrSerdeable::LidarrHistoryItems(history_items) = network
|
||||
.handle_lidarr_event(LidarrEvent::GetArtistHistory(1))
|
||||
.await
|
||||
.unwrap()
|
||||
else {
|
||||
panic!("Expected LidarrHistoryItems")
|
||||
};
|
||||
async_server.assert_async().await;
|
||||
let app = app.lock().await;
|
||||
assert_some!(&app.data.lidarr_data.artist_history);
|
||||
assert_eq!(
|
||||
app.data.lidarr_data.artist_history.as_ref().unwrap().items,
|
||||
expected_history_items
|
||||
);
|
||||
assert!(
|
||||
!app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.sort_asc
|
||||
);
|
||||
assert_eq!(history_items, response);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_handle_get_lidarr_artist_history_event_no_op_when_user_is_selecting_sort_options() {
|
||||
let history_json = json!([{
|
||||
"id": 123,
|
||||
"sourceTitle": "z album",
|
||||
"albumId": 1007,
|
||||
"artistId": 1007,
|
||||
"quality": { "quality": { "name": "Lossless" } },
|
||||
"date": "2023-01-01T00:00:00Z",
|
||||
"eventType": "grabbed",
|
||||
"data": {
|
||||
"droppedPath": "/nfs/nzbget/completed/music/Something/cool.mp3",
|
||||
"importedPath": "/nfs/music/Something/Album 1/Cool.mp3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 456,
|
||||
"sourceTitle": "An Album",
|
||||
"albumId": 2001,
|
||||
"artistId": 2001,
|
||||
"quality": { "quality": { "name": "Lossless" } },
|
||||
"date": "2023-01-01T00:00:00Z",
|
||||
"eventType": "grabbed",
|
||||
"data": {
|
||||
"droppedPath": "/nfs/nzbget/completed/music/Something/cool.mp3",
|
||||
"importedPath": "/nfs/music/Something/Album 1/Cool.mp3"
|
||||
}
|
||||
}]);
|
||||
let response: Vec<LidarrHistoryItem> = serde_json::from_value(history_json.clone()).unwrap();
|
||||
let (async_server, app, _server) = MockServarrApi::get()
|
||||
.returns(history_json)
|
||||
.query("artistId=1")
|
||||
.build_for(LidarrEvent::GetArtistHistory(1))
|
||||
.await;
|
||||
let cmp_fn = |a: &LidarrHistoryItem, b: &LidarrHistoryItem| {
|
||||
a.source_title
|
||||
.text
|
||||
.to_lowercase()
|
||||
.cmp(&b.source_title.text.to_lowercase())
|
||||
};
|
||||
let history_sort_option = SortOption {
|
||||
name: "Source Title",
|
||||
cmp_fn: Some(cmp_fn),
|
||||
};
|
||||
let mut artist_history_table = StatefulTable {
|
||||
sort_asc: true,
|
||||
..StatefulTable::default()
|
||||
};
|
||||
artist_history_table.sorting(vec![history_sort_option]);
|
||||
app.lock().await.data.lidarr_data.artist_history = Some(artist_history_table);
|
||||
app
|
||||
.lock()
|
||||
.await
|
||||
.data
|
||||
.lidarr_data
|
||||
.artists
|
||||
.set_items(vec![artist()]);
|
||||
app
|
||||
.lock()
|
||||
.await
|
||||
.push_navigation_stack(ActiveLidarrBlock::ArtistHistorySortPrompt.into());
|
||||
app.lock().await.server_tabs.set_index(2);
|
||||
let mut network = test_network(&app);
|
||||
|
||||
let LidarrSerdeable::LidarrHistoryItems(history_items) = network
|
||||
.handle_lidarr_event(LidarrEvent::GetArtistHistory(1))
|
||||
.await
|
||||
.unwrap()
|
||||
else {
|
||||
panic!("Expected LidarrHistoryItems")
|
||||
};
|
||||
async_server.assert_async().await;
|
||||
let app = app.lock().await;
|
||||
assert_some!(&app.data.lidarr_data.artist_history);
|
||||
assert!(
|
||||
app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.is_empty()
|
||||
);
|
||||
assert!(
|
||||
app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.sort_asc
|
||||
);
|
||||
assert_eq!(history_items, response);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_handle_toggle_artist_monitoring_event() {
|
||||
let artist_json = json!({
|
||||
|
||||
@@ -5,6 +5,7 @@ use serde_json::{Value, json};
|
||||
use crate::models::Route;
|
||||
use crate::models::lidarr_models::{
|
||||
AddArtistBody, AddArtistSearchResult, Artist, DeleteParams, EditArtistParams, LidarrCommandBody,
|
||||
LidarrHistoryItem,
|
||||
};
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
@@ -281,6 +282,41 @@ impl Network<'_, '_> {
|
||||
.await
|
||||
}
|
||||
|
||||
pub(in crate::network::lidarr_network) async fn get_lidarr_artist_history(
|
||||
&mut self,
|
||||
artist_id: i64,
|
||||
) -> Result<Vec<LidarrHistoryItem>> {
|
||||
info!("Fetching Lidarr artist history for artist with ID: {artist_id}");
|
||||
let event = LidarrEvent::GetArtistHistory(artist_id);
|
||||
|
||||
let request_props = self
|
||||
.request_props_from(
|
||||
event,
|
||||
RequestMethod::Get,
|
||||
None::<()>,
|
||||
None,
|
||||
Some(format!("artistId={artist_id}")),
|
||||
)
|
||||
.await;
|
||||
|
||||
self
|
||||
.handle_request::<(), Vec<LidarrHistoryItem>>(request_props, |mut history_vec, mut app| {
|
||||
let is_sorting = matches!(
|
||||
app.get_current_route(),
|
||||
Route::Lidarr(ActiveLidarrBlock::ArtistHistorySortPrompt, _)
|
||||
);
|
||||
|
||||
let artist_history = app.data.lidarr_data.artist_history.get_or_insert_default();
|
||||
|
||||
if !is_sorting {
|
||||
history_vec.sort_by(|a, b| a.id.cmp(&b.id));
|
||||
artist_history.set_items(history_vec);
|
||||
artist_history.apply_sorting_toggle(false);
|
||||
}
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub(in crate::network::lidarr_network) async fn edit_artist(
|
||||
&mut self,
|
||||
mut edit_artist_params: EditArtistParams,
|
||||
|
||||
@@ -135,6 +135,7 @@ mod tests {
|
||||
#[case(LidarrEvent::GetUpdates, "/update")]
|
||||
#[case(LidarrEvent::HealthCheck, "/health")]
|
||||
#[case(LidarrEvent::MarkHistoryItemAsFailed(0), "/history/failed")]
|
||||
#[case(LidarrEvent::GetArtistHistory(0), "/history/artist")]
|
||||
#[case(LidarrEvent::TestIndexer(0), "/indexer/test")]
|
||||
#[case(LidarrEvent::TestAllIndexers, "/indexer/testall")]
|
||||
fn test_resource(#[case] event: LidarrEvent, #[case] expected_uri: &str) {
|
||||
|
||||
@@ -40,6 +40,7 @@ pub enum LidarrEvent {
|
||||
EditIndexer(EditIndexerParams),
|
||||
GetAlbums(i64),
|
||||
GetAlbumDetails(i64),
|
||||
GetArtistHistory(i64),
|
||||
GetAllIndexerSettings,
|
||||
GetArtistDetails(i64),
|
||||
GetDiskSpace,
|
||||
@@ -89,6 +90,7 @@ impl NetworkResource for LidarrEvent {
|
||||
| LidarrEvent::ToggleAlbumMonitoring(_)
|
||||
| LidarrEvent::GetAlbumDetails(_)
|
||||
| LidarrEvent::DeleteAlbum(_) => "/album",
|
||||
LidarrEvent::GetArtistHistory(_) => "/history/artist",
|
||||
LidarrEvent::GetLogs(_) => "/log",
|
||||
LidarrEvent::GetDiskSpace => "/diskspace",
|
||||
LidarrEvent::GetDownloads(_) | LidarrEvent::DeleteDownload(_) => "/queue",
|
||||
@@ -192,6 +194,10 @@ impl Network<'_, '_> {
|
||||
.get_lidarr_history(events)
|
||||
.await
|
||||
.map(LidarrSerdeable::from),
|
||||
LidarrEvent::GetArtistHistory(artist_id) => self
|
||||
.get_lidarr_artist_history(artist_id)
|
||||
.await
|
||||
.map(LidarrSerdeable::from),
|
||||
LidarrEvent::GetLogs(events) => self
|
||||
.get_lidarr_logs(events)
|
||||
.await
|
||||
|
||||
@@ -5,7 +5,7 @@ mod tests {
|
||||
use crate::models::stateful_table::SortOption;
|
||||
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
||||
use crate::network::sonarr_network::SonarrEvent;
|
||||
use crate::network::sonarr_network::sonarr_network_test_utils::test_utils::history_item;
|
||||
use crate::network::sonarr_network::sonarr_network_test_utils::test_utils::sonarr_history_item;
|
||||
use pretty_assertions::assert_eq;
|
||||
use rstest::rstest;
|
||||
use serde_json::json;
|
||||
@@ -45,13 +45,13 @@ mod tests {
|
||||
id: 123,
|
||||
episode_id: 1007,
|
||||
source_title: "z episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
SonarrHistoryItem {
|
||||
id: 456,
|
||||
episode_id: 2001,
|
||||
source_title: "A Episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
];
|
||||
let (mock, app, _server) = MockServarrApi::get()
|
||||
|
||||
@@ -12,7 +12,7 @@ mod tests {
|
||||
use crate::network::sonarr_network::SonarrEvent;
|
||||
use crate::network::sonarr_network::library::episodes::get_episode_status;
|
||||
use crate::network::sonarr_network::sonarr_network_test_utils::test_utils::{
|
||||
EPISODE_JSON, episode, episode_file, history_item, torrent_release,
|
||||
EPISODE_JSON, episode, episode_file, sonarr_history_item, torrent_release,
|
||||
};
|
||||
use indoc::formatdoc;
|
||||
use mockito::Matcher;
|
||||
@@ -522,13 +522,13 @@ mod tests {
|
||||
id: 123,
|
||||
episode_id: 1007,
|
||||
source_title: "z episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
SonarrHistoryItem {
|
||||
id: 456,
|
||||
episode_id: 2001,
|
||||
source_title: "A Episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
];
|
||||
let (async_server, app_arc, _server) = MockServarrApi::get()
|
||||
@@ -649,13 +649,13 @@ mod tests {
|
||||
id: 123,
|
||||
episode_id: 1007,
|
||||
source_title: "z episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
SonarrHistoryItem {
|
||||
id: 456,
|
||||
episode_id: 2001,
|
||||
source_title: "A Episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
];
|
||||
let (async_server, app_arc, _server) = MockServarrApi::get()
|
||||
@@ -754,13 +754,13 @@ mod tests {
|
||||
id: 123,
|
||||
episode_id: 1007,
|
||||
source_title: "z episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
SonarrHistoryItem {
|
||||
id: 456,
|
||||
episode_id: 2001,
|
||||
source_title: "A Episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
];
|
||||
let (async_server, app_arc, _server) = MockServarrApi::get()
|
||||
|
||||
@@ -6,7 +6,7 @@ mod tests {
|
||||
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
||||
use crate::network::sonarr_network::SonarrEvent;
|
||||
use crate::network::sonarr_network::sonarr_network_test_utils::test_utils::{
|
||||
SERIES_JSON, history_item, season, series, torrent_release,
|
||||
SERIES_JSON, season, series, sonarr_history_item, torrent_release,
|
||||
};
|
||||
use mockito::Matcher;
|
||||
use pretty_assertions::assert_eq;
|
||||
@@ -278,13 +278,13 @@ mod tests {
|
||||
id: 123,
|
||||
episode_id: 1007,
|
||||
source_title: "z episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
SonarrHistoryItem {
|
||||
id: 456,
|
||||
episode_id: 2001,
|
||||
source_title: "A Episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
];
|
||||
let (mock, app, _server) = MockServarrApi::get()
|
||||
@@ -390,13 +390,13 @@ mod tests {
|
||||
id: 123,
|
||||
episode_id: 1007,
|
||||
source_title: "z episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
SonarrHistoryItem {
|
||||
id: 456,
|
||||
episode_id: 2001,
|
||||
source_title: "A Episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
];
|
||||
let (mock, app, _server) = MockServarrApi::get()
|
||||
|
||||
@@ -10,7 +10,7 @@ mod tests {
|
||||
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
||||
use crate::network::sonarr_network::SonarrEvent;
|
||||
use crate::network::sonarr_network::sonarr_network_test_utils::test_utils::{
|
||||
SERIES_JSON, add_series_search_result, history_item, season, series,
|
||||
SERIES_JSON, add_series_search_result, season, series, sonarr_history_item,
|
||||
};
|
||||
use bimap::BiMap;
|
||||
use mockito::Matcher;
|
||||
@@ -457,13 +457,13 @@ mod tests {
|
||||
id: 123,
|
||||
episode_id: 1007,
|
||||
source_title: "z episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
SonarrHistoryItem {
|
||||
id: 456,
|
||||
episode_id: 2001,
|
||||
source_title: "A Episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
];
|
||||
let (async_server, app, _server) = MockServarrApi::get()
|
||||
@@ -570,13 +570,13 @@ mod tests {
|
||||
id: 123,
|
||||
episode_id: 1007,
|
||||
source_title: "z episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
SonarrHistoryItem {
|
||||
id: 456,
|
||||
episode_id: 2001,
|
||||
source_title: "A Episode".into(),
|
||||
..history_item()
|
||||
..sonarr_history_item()
|
||||
},
|
||||
];
|
||||
let (async_server, app, _server) = MockServarrApi::get()
|
||||
|
||||
@@ -203,7 +203,7 @@ pub mod test_utils {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn history_item() -> SonarrHistoryItem {
|
||||
pub fn sonarr_history_item() -> SonarrHistoryItem {
|
||||
SonarrHistoryItem {
|
||||
id: 1,
|
||||
source_title: "Test source".into(),
|
||||
|
||||
+1
-2
@@ -17,6 +17,7 @@ expression: output
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Details ───────────────────────────────────╮
|
||||
│Source Title: Test source title │
|
||||
│Event Type: grabbed │
|
||||
@@ -34,6 +35,4 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+1
-2
@@ -17,6 +17,7 @@ expression: output
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Details ───────────────────────────────────╮
|
||||
│Source Title: │
|
||||
│Event Type: unknown │
|
||||
@@ -34,6 +35,4 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
@@ -9,18 +9,23 @@ use regex::Regex;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::Route;
|
||||
use crate::models::lidarr_models::Album;
|
||||
use crate::models::lidarr_models::{Album, LidarrHistoryItem};
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::{ARTIST_DETAILS_BLOCKS, ActiveLidarrBlock};
|
||||
use crate::ui::lidarr_ui::library::delete_album_ui::DeleteAlbumUi;
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::lidarr_ui::lidarr_ui_utils::create_history_event_details;
|
||||
use crate::ui::styles::{ManagarrStyle, secondary_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;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "artist_details_ui_tests.rs"]
|
||||
@@ -53,7 +58,7 @@ impl DrawUi for ArtistDetailsUi {
|
||||
popup_area,
|
||||
);
|
||||
let [description_area, detail_area] =
|
||||
Layout::vertical([Constraint::Percentage(37), Constraint::Fill(0)])
|
||||
Layout::vertical([Constraint::Length(14), Constraint::Fill(0)])
|
||||
.margin(1)
|
||||
.areas(popup_area);
|
||||
draw_artist_description(f, app, description_area);
|
||||
@@ -67,6 +72,9 @@ impl DrawUi for ArtistDetailsUi {
|
||||
|
||||
match active_lidarr_block {
|
||||
_ if DeleteAlbumUi::accepts(route) => DeleteAlbumUi::draw(f, app, area),
|
||||
ActiveLidarrBlock::ArtistHistoryDetails => {
|
||||
draw_artist_history_item_details_popup(f, app);
|
||||
}
|
||||
ActiveLidarrBlock::AutomaticallySearchArtistPrompt => {
|
||||
let prompt = format!(
|
||||
"Do you want to trigger an automatic search of your indexers for all monitored album(s) for the artist: {}?",
|
||||
@@ -232,6 +240,7 @@ fn draw_artist_details(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
{
|
||||
match active_lidarr_block {
|
||||
ActiveLidarrBlock::ArtistDetails => draw_albums_table(f, app, area),
|
||||
ActiveLidarrBlock::ArtistHistory => draw_artist_history_table(f, app, area),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
@@ -327,3 +336,108 @@ fn draw_albums_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
f.render_widget(album_table, area);
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_artist_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
match app.data.lidarr_data.artist_history.as_ref() {
|
||||
Some(artist_history) if !app.is_loading => {
|
||||
let current_selection = if artist_history.is_empty() {
|
||||
LidarrHistoryItem::default()
|
||||
} else {
|
||||
artist_history.current_selection().clone()
|
||||
};
|
||||
|
||||
if let Route::Lidarr(active_lidarr_block, _) = app.get_current_route() {
|
||||
let history_row_mapping = |history_item: &LidarrHistoryItem| {
|
||||
let LidarrHistoryItem {
|
||||
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.ui_scroll_tick_count == 0,
|
||||
);
|
||||
|
||||
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 mut artist_history_table = app
|
||||
.data
|
||||
.lidarr_data
|
||||
.artist_history
|
||||
.as_mut()
|
||||
.expect("artist_history must be populated");
|
||||
let history_table =
|
||||
ManagarrTable::new(Some(&mut artist_history_table), history_row_mapping)
|
||||
.block(layout_block_top_border())
|
||||
.loading(app.is_loading)
|
||||
.sorting(active_lidarr_block == ActiveLidarrBlock::ArtistHistorySortPrompt)
|
||||
.searching(active_lidarr_block == ActiveLidarrBlock::SearchArtistHistory)
|
||||
.search_produced_empty_results(
|
||||
active_lidarr_block == ActiveLidarrBlock::SearchArtistHistoryError,
|
||||
)
|
||||
.filtering(active_lidarr_block == ActiveLidarrBlock::FilterArtistHistory)
|
||||
.filter_produced_empty_results(
|
||||
active_lidarr_block == ActiveLidarrBlock::FilterArtistHistoryError,
|
||||
)
|
||||
.headers(["Source Title", "Event Type", "Quality", "Date"])
|
||||
.constraints([
|
||||
Constraint::Percentage(40),
|
||||
Constraint::Percentage(20),
|
||||
Constraint::Percentage(15),
|
||||
Constraint::Percentage(25),
|
||||
]);
|
||||
|
||||
if [
|
||||
ActiveLidarrBlock::SearchArtistHistory,
|
||||
ActiveLidarrBlock::FilterArtistHistory,
|
||||
]
|
||||
.contains(&active_lidarr_block)
|
||||
{
|
||||
history_table.show_cursor(f, area);
|
||||
}
|
||||
|
||||
f.render_widget(history_table, area);
|
||||
}
|
||||
}
|
||||
_ => f.render_widget(
|
||||
LoadingBlock::new(
|
||||
app.is_loading || app.data.lidarr_data.albums.is_empty(),
|
||||
layout_block_top_border(),
|
||||
),
|
||||
area,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_artist_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let current_selection =
|
||||
if let Some(artist_history_items) = app.data.lidarr_data.artist_history.as_ref() {
|
||||
if artist_history_items.is_empty() {
|
||||
LidarrHistoryItem::default()
|
||||
} else {
|
||||
artist_history_items.current_selection().clone()
|
||||
}
|
||||
} else {
|
||||
LidarrHistoryItem::default()
|
||||
};
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -37,10 +37,19 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
#[case(ActiveLidarrBlock::ArtistDetails, 0)]
|
||||
#[case(ActiveLidarrBlock::ArtistHistory, 1)]
|
||||
#[case(ActiveLidarrBlock::SearchAlbums, 0)]
|
||||
#[case(ActiveLidarrBlock::SearchAlbumsError, 0)]
|
||||
#[case(ActiveLidarrBlock::UpdateAndScanArtistPrompt, 0)]
|
||||
#[case(ActiveLidarrBlock::UpdateAndScanArtistPrompt, 1)]
|
||||
#[case(ActiveLidarrBlock::AutomaticallySearchArtistPrompt, 0)]
|
||||
#[case(ActiveLidarrBlock::AutomaticallySearchArtistPrompt, 1)]
|
||||
#[case(ActiveLidarrBlock::SearchArtistHistory, 1)]
|
||||
#[case(ActiveLidarrBlock::SearchArtistHistoryError, 1)]
|
||||
#[case(ActiveLidarrBlock::FilterArtistHistory, 1)]
|
||||
#[case(ActiveLidarrBlock::FilterArtistHistoryError, 1)]
|
||||
#[case(ActiveLidarrBlock::ArtistHistorySortPrompt, 1)]
|
||||
#[case(ActiveLidarrBlock::ArtistHistoryDetails, 1)]
|
||||
fn test_artist_details_ui_renders(
|
||||
#[case] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[case] index: usize,
|
||||
@@ -61,6 +70,7 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
#[case(ActiveLidarrBlock::ArtistDetails, 0)]
|
||||
#[case(ActiveLidarrBlock::ArtistHistory, 1)]
|
||||
fn test_artist_details_ui_renders_artist_details_loading(
|
||||
#[case] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[case] index: usize,
|
||||
@@ -82,6 +92,8 @@ mod tests {
|
||||
|
||||
#[rstest]
|
||||
#[case(ActiveLidarrBlock::ArtistDetails, 0)]
|
||||
#[case(ActiveLidarrBlock::ArtistHistory, 1)]
|
||||
#[case(ActiveLidarrBlock::ArtistHistoryDetails, 1)]
|
||||
fn test_artist_details_ui_renders_artist_details_empty(
|
||||
#[case] active_lidarr_block: ActiveLidarrBlock,
|
||||
#[case] index: usize,
|
||||
|
||||
+3
-3
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums ││
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Type Tracks Duration Release Date Size ││
|
||||
││=> 🏷 Test Album Album 10/10 0 min 2023-01-01 0.00 GB ││
|
||||
@@ -48,5 +46,7 @@ expression: output
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │Source Title: Test source title │ │
|
||||
│╭ Artist Details ─────────────│Event Type: grabbed │───────────────────────────────╮│
|
||||
││ Albums │ History │Quality: Lossless │ ││
|
||||
││───────────────────────────────│Date: 2023-01-01 00:00:00 UTC │───────────────────────────────││
|
||||
││ Source Title ▼ │Indexer: │ ││
|
||||
││=> Test source title │NZB Info URL: │-01-01 00:00:00 UTC ││
|
||||
││ │Release Group: │ ││
|
||||
││ │Age: 0 days │ ││
|
||||
││ │Published Date: 1970-01-01 00:00:00 UTC │ ││
|
||||
││ │Download Client: │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title Event Type Quality Date ││
|
||||
││=> Test source title grabbed Lossless 2023-01-01 00:00:00 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭───────────────────────────╮ ││
|
||||
││ │Something │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰───────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test source title grabbed Lossless 2023-01-01 00:00:00 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+4
-4
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭──────────────── Automatic Artist Search ────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │Do you want to trigger an automatic search of your indexers│ │
|
||||
│ │ for all monitored album(s) for the artist: Alex? │ │
|
||||
│ │ │ │
|
||||
│╭ Artist Details ───────────────────────│ │───────────────────────────────────────────╮│
|
||||
││ Albums │ │ ││
|
||||
│╭ Artist Details ───────────────────────│ for all monitored album(s) for the artist: Alex? │───────────────────────────────────────────╮│
|
||||
││ Albums │ History │ │ ││
|
||||
││─────────────────────────────────────────│ │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │ Release Date Size ││
|
||||
││=> 🏷 Test Album │ │ 2023-01-01 0.00 GB ││
|
||||
@@ -32,6 +30,8 @@ expression: output
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭──────────────── Automatic Artist Search ────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │Do you want to trigger an automatic search of your indexers│ │
|
||||
│╭ Artist Details ───────────────────────│ for all monitored album(s) for the artist: Alex? │───────────────────────────────────────────╮│
|
||||
││ Albums │ History │ │ ││
|
||||
││─────────────────────────────────────────│ │───────────────────────────────────────────││
|
||||
││ Source Title ▼ │ │ Date ││
|
||||
││=> Test source title │ │ 2023-01-01 00:00:00 UTC ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test source title grabbed Lossless 2023-01-01 00:00:00 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭──────────── Error ─────────────╮ ││
|
||||
││ │ The given filter produced empty │ ││
|
||||
││ ╰──────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test source title grabbed Lossless 2023-01-01 00:00:00 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭────────────── Filter ───────────────╮ ││
|
||||
││ │artist history filter │ ││
|
||||
││ ╰───────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+3
-3
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums ││
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Type Tracks Duration Release Date Size ││
|
||||
││=> 🏷 Test Album Album 10/10 0 min 2023-01-01 0.00 GB ││
|
||||
@@ -35,6 +33,7 @@ expression: output
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭──────────── Error ─────────────╮ ││
|
||||
││ │ No items found matching search │ ││
|
||||
││ ╰──────────────────────────────────╯ ││
|
||||
@@ -48,5 +47,6 @@ expression: output
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+3
-3
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums ││
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Type Tracks Duration Release Date Size ││
|
||||
││=> 🏷 Test Album Album 10/10 0 min 2023-01-01 0.00 GB ││
|
||||
@@ -48,5 +46,7 @@ expression: output
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test source title grabbed Lossless 2023-01-01 00:00:00 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭──────────── Error ─────────────╮ ││
|
||||
││ │ No items found matching search │ ││
|
||||
││ ╰──────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test source title grabbed Lossless 2023-01-01 00:00:00 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ╭────────────── Search ───────────────╮ ││
|
||||
││ │artist history search │ ││
|
||||
││ ╰───────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+4
-4
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭──────────────────── Update and Scan ────────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │ Do you want to trigger an update and disk scan for the │ │
|
||||
│ │ artist: Alex? │ │
|
||||
│ │ │ │
|
||||
│╭ Artist Details ───────────────────────│ │───────────────────────────────────────────╮│
|
||||
││ Albums │ │ ││
|
||||
│╭ Artist Details ───────────────────────│ artist: Alex? │───────────────────────────────────────────╮│
|
||||
││ Albums │ History │ │ ││
|
||||
││─────────────────────────────────────────│ │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │ Release Date Size ││
|
||||
││=> 🏷 Test Album │ │ 2023-01-01 0.00 GB ││
|
||||
@@ -32,6 +30,8 @@ expression: output
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭──────────────────── Update and Scan ────────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │ Do you want to trigger an update and disk scan for the │ │
|
||||
│╭ Artist Details ───────────────────────│ artist: Alex? │───────────────────────────────────────────╮│
|
||||
││ Albums │ History │ │ ││
|
||||
││─────────────────────────────────────────│ │───────────────────────────────────────────││
|
||||
││ Source Title ▼ │ │ Date ││
|
||||
││=> Test source title │ │ 2023-01-01 00:00:00 UTC ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
││ ╰───────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+4
-4
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭──────────────── Automatic Artist Search ────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │Do you want to trigger an automatic search of your indexers│ │
|
||||
│ │ for all monitored album(s) for the artist: Alex? │ │
|
||||
│ │ │ │
|
||||
│╭ Artist Details ───────────────────────│ │───────────────────────────────────────────╮│
|
||||
││ Albums │ │ ││
|
||||
│╭ Artist Details ───────────────────────│ for all monitored album(s) for the artist: Alex? │───────────────────────────────────────────╮│
|
||||
││ Albums │ History │ │ ││
|
||||
││─────────────────────────────────────────│ │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │ Release Date Size ││
|
||||
││=> 🏷 Test Album │ │ 2023-01-01 0.00 GB ││
|
||||
@@ -32,6 +30,8 @@ expression: output
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
|
||||
+7
-7
@@ -20,13 +20,13 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭───────────────────── Delete Album ──────────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │ Do you really want to delete the album: │ │
|
||||
│ │ Test Album? │ │
|
||||
│ │ │ │
|
||||
│╭ Artist Details ───────────────────────│ │───────────────────────────────────────────╮│
|
||||
││ Albums │ ╭───╮ │ ││
|
||||
││─────────────────────────────────────────│ Delete Album Files: │ ✔ │ │───────────────────────────────────────────││
|
||||
││ Monitored Title │ ╰───╯ │ Release Date Size ││
|
||||
││=> 🏷 Test Album │ ╭───╮ │ 2023-01-01 0.00 GB ││
|
||||
│╭ Artist Details ───────────────────────│ Test Album? │───────────────────────────────────────────╮│
|
||||
││ Albums │ History │ │ ││
|
||||
││─────────────────────────────────────────│ │───────────────────────────────────────────││
|
||||
││ Monitored Title │ ╭───╮ │ Release Date Size ││
|
||||
││=> 🏷 Test Album │ Delete Album Files: │ ✔ │ │ 2023-01-01 0.00 GB ││
|
||||
││ │ ╰───╯ │ ││
|
||||
││ │ ╭───╮ │ ││
|
||||
││ │ Add List Exclusion: │ │ │ ││
|
||||
││ │ ╰───╯ │ ││
|
||||
││ │ │ ││
|
||||
|
||||
+4
-4
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭──────────────────── Update and Scan ────────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │ Do you want to trigger an update and disk scan for the │ │
|
||||
│ │ artist: Alex? │ │
|
||||
│ │ │ │
|
||||
│╭ Artist Details ───────────────────────│ │───────────────────────────────────────────╮│
|
||||
││ Albums │ │ ││
|
||||
│╭ Artist Details ───────────────────────│ artist: Alex? │───────────────────────────────────────────╮│
|
||||
││ Albums │ History │ │ ││
|
||||
││─────────────────────────────────────────│ │───────────────────────────────────────────││
|
||||
││ Monitored Title │ │ Release Date Size ││
|
||||
││=> 🏷 Test Album │ │ 2023-01-01 0.00 GB ││
|
||||
@@ -32,6 +30,8 @@ expression: output
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │╭────────────────────────────╮╭───────────────────────────╮│ ││
|
||||
││ ││ Yes ││ No ││ ││
|
||||
││ │╰────────────────────────────╯╰───────────────────────────╯│ ││
|
||||
|
||||
+3
-3
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums ││
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
@@ -48,5 +46,7 @@ expression: output
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Source Title ▼ Event Type Quality Date ││
|
||||
││=> Test source title grabbed Lossless 2023-01-01 00:00:00 UTC ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│Size on Disk: 0.00 GB │Source Title: Test source title │ │
|
||||
│╭ Artist Details ─────────────│Event Type: grabbed │───────────────────────────────╮│
|
||||
││ Albums │ History │Quality: Lossless │ ││
|
||||
││───────────────────────────────│Date: 2023-01-01 00:00:00 UTC │───────────────────────────────││
|
||||
││ Source Title ▼ │Indexer: │ ││
|
||||
││=> Test source title │NZB Info URL: │-01-01 00:00:00 UTC ││
|
||||
││ │Release Group: │ ││
|
||||
││ │Age: 0 days │ ││
|
||||
││ │Published Date: 1970-01-01 00:00:00 UTC │ ││
|
||||
││ │Download Client: │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+3
-3
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums ││
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
@@ -48,5 +46,7 @@ expression: output
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/library/artist_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
╭ Alex ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Artist: Alex │
|
||||
│Overview: some interesting description of the artist │
|
||||
│Disambiguation: American pianist │
|
||||
│Type: Person │
|
||||
│Status: Continuing │
|
||||
│Genres: soundtrack │
|
||||
│Rating: 84% │
|
||||
│Path: /nfs/music/test-artist │
|
||||
│Quality Profile: Lossless │
|
||||
│Metadata Profile: Standard │
|
||||
│Monitored: Yes │
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ ││
|
||||
││ ││
|
||||
││ Loading ... ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+3
-3
@@ -20,10 +20,8 @@ expression: output
|
||||
│Albums: 1 │
|
||||
│Tracks: 15/15 │
|
||||
│Size on Disk: 0.00 GB │
|
||||
│ │
|
||||
│ │
|
||||
│╭ Artist Details ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│
|
||||
││ Albums ││
|
||||
││ Albums │ History ││
|
||||
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
|
||||
││ Monitored Title Type Tracks Duration Release Date Size ││
|
||||
││=> 🏷 Test Album Album 10/10 0 min 2023-01-01 0.00 GB ││
|
||||
@@ -48,5 +46,7 @@ expression: output
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
│╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+1
-2
@@ -17,6 +17,7 @@ expression: output
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Details ───────────────────────────────────╮
|
||||
│Source Title: Test │
|
||||
│Event Type: grabbed │
|
||||
@@ -34,6 +35,4 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+1
-2
@@ -17,6 +17,7 @@ expression: output
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Details ───────────────────────────────────╮
|
||||
│Source Title: │
|
||||
│Event Type: unknown │
|
||||
@@ -34,6 +35,4 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+1
-2
@@ -17,6 +17,7 @@ expression: output
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Details ───────────────────────────────────╮
|
||||
│Source Title: Test source │
|
||||
│Event Type: grabbed │
|
||||
@@ -34,6 +35,4 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
+1
-2
@@ -17,6 +17,7 @@ expression: output
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Details ───────────────────────────────────╮
|
||||
│Source Title: │
|
||||
│Event Type: unknown │
|
||||
@@ -34,6 +35,4 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
@@ -95,7 +95,7 @@ impl DrawUi for EpisodeDetailsUi {
|
||||
draw_manual_episode_search_confirm_prompt(f, app);
|
||||
}
|
||||
ActiveSonarrBlock::EpisodeHistoryDetails => {
|
||||
draw_history_item_details_popup(f, app, popup_area);
|
||||
draw_history_item_details_popup(f, app);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
@@ -347,7 +347,7 @@ fn draw_episode_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect)
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let current_selection =
|
||||
if let Some(season_details_modal) = app.data.sonarr_data.season_details_modal.as_ref() {
|
||||
if let Some(episode_details_modal) = season_details_modal.episode_details_modal.as_ref() {
|
||||
@@ -374,7 +374,7 @@ fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>, area: R
|
||||
.style(secondary_style())
|
||||
.alignment(Alignment::Left);
|
||||
|
||||
f.render_widget(Popup::new(message).size(Size::NarrowLongMessage), area);
|
||||
f.render_widget(Popup::new(message).size(Size::NarrowLongMessage), f.area());
|
||||
}
|
||||
|
||||
fn draw_episode_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
|
||||
@@ -117,7 +117,7 @@ impl DrawUi for SeasonDetailsUi {
|
||||
draw_manual_season_search_confirm_prompt(f, app);
|
||||
}
|
||||
ActiveSonarrBlock::SeasonHistoryDetails => {
|
||||
draw_history_item_details_popup(f, app, popup_area);
|
||||
draw_history_item_details_popup(f, app);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
@@ -527,7 +527,7 @@ fn draw_manual_season_search_confirm_prompt(f: &mut Frame<'_>, app: &mut App<'_>
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let current_selection =
|
||||
if let Some(season_details_modal) = app.data.sonarr_data.season_details_modal.as_ref() {
|
||||
if season_details_modal.season_history.is_empty() {
|
||||
@@ -550,7 +550,7 @@ fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>, area: R
|
||||
.style(secondary_style())
|
||||
.alignment(Alignment::Left);
|
||||
|
||||
f.render_widget(Popup::new(message).size(Size::NarrowLongMessage), area);
|
||||
f.render_widget(Popup::new(message).size(Size::NarrowLongMessage), f.area());
|
||||
}
|
||||
|
||||
fn decorate_with_row_style<'a>(
|
||||
|
||||
@@ -96,7 +96,7 @@ impl DrawUi for SeriesDetailsUi {
|
||||
);
|
||||
}
|
||||
ActiveSonarrBlock::SeriesHistoryDetails => {
|
||||
draw_history_item_details_popup(f, app, popup_area);
|
||||
draw_history_item_details_popup(f, app);
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
@@ -388,7 +388,7 @@ fn draw_series_history_table(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
||||
let current_selection =
|
||||
if let Some(series_history_items) = app.data.sonarr_data.series_history.as_ref() {
|
||||
if series_history_items.is_empty() {
|
||||
@@ -408,5 +408,5 @@ fn draw_history_item_details_popup(f: &mut Frame<'_>, app: &mut App<'_>, area: R
|
||||
.style(secondary_style())
|
||||
.alignment(Alignment::Left);
|
||||
|
||||
f.render_widget(Popup::new(message).size(Size::NarrowLongMessage), area);
|
||||
f.render_widget(Popup::new(message).size(Size::NarrowLongMessage), f.area());
|
||||
}
|
||||
|
||||
+18
-18
@@ -18,24 +18,24 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭──────────────────────── Details ─────────────────────────╮ │
|
||||
│ │Source Title: │ │
|
||||
│ │Event Type: unknown │ │
|
||||
│ │ │ │
|
||||
│ │No additional data available │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│ │Source Title: │ │
|
||||
│ │Event Type: unknown │ │
|
||||
│ │ │ │
|
||||
│ │No additional data available │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+18
-18
@@ -18,24 +18,24 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭──────────────────────── Details ─────────────────────────╮ │
|
||||
│ │Source Title: Test source │ │
|
||||
│ │Event Type: grabbed │ │
|
||||
│ │Indexer: │ │
|
||||
│ │Release Group: │ │
|
||||
│ │Series Match Type: │ │
|
||||
│ │NZB Info URL: │ │
|
||||
│ │Download Client Name: │ │
|
||||
│ │Age: 0 days │ │
|
||||
│ │Published Date: 1970-01-01 00:00:00 UTC │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│ │Source Title: Test source │ │
|
||||
│ │Event Type: grabbed │ │
|
||||
│ │Indexer: │ │
|
||||
│ │Release Group: │ │
|
||||
│ │Series Match Type: │ │
|
||||
│ │NZB Info URL: │ │
|
||||
│ │Download Client Name: │ │
|
||||
│ │Age: 0 days │ │
|
||||
│ │Published Date: 1970-01-01 00:00:00 UTC │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+18
-18
@@ -18,24 +18,24 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭──────────────────────────── Details ────────────────────────────╮ │
|
||||
│ │Source Title: │ │
|
||||
│ │Event Type: unknown │ │
|
||||
│ │ │ │
|
||||
│ │No additional data available │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰───────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│ │Source Title: │ │
|
||||
│ │Event Type: unknown │ │
|
||||
│ │ │ │
|
||||
│ │No additional data available │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+18
-18
@@ -18,24 +18,24 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭──────────────────────────── Details ────────────────────────────╮ │
|
||||
│ │Source Title: │ │
|
||||
│ │Event Type: unknown │ │
|
||||
│ │ │ │
|
||||
│ │No additional data available │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰───────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│ │Source Title: │ │
|
||||
│ │Event Type: unknown │ │
|
||||
│ │ │ │
|
||||
│ │No additional data available │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+18
-18
@@ -18,24 +18,24 @@ expression: output
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭──────────────────────────── Details ────────────────────────────╮ │
|
||||
│ │Source Title: Test source │ │
|
||||
│ │Event Type: grabbed │ │
|
||||
│ │Indexer: │ │
|
||||
│ │Release Group: │ │
|
||||
│ │Series Match Type: │ │
|
||||
│ │NZB Info URL: │ │
|
||||
│ │Download Client Name: │ │
|
||||
│ │Age: 0 days │ │
|
||||
│ │Published Date: 1970-01-01 00:00:00 UTC │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰───────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│ │Source Title: Test source │ │
|
||||
│ │Event Type: grabbed │ │
|
||||
│ │Indexer: │ │
|
||||
│ │Release Group: │ │
|
||||
│ │Series Match Type: │ │
|
||||
│ │NZB Info URL: │ │
|
||||
│ │Download Client Name: │ │
|
||||
│ │Age: 0 days │ │
|
||||
│ │Published Date: 1970-01-01 00:00:00 UTC │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
+19
-19
@@ -18,25 +18,25 @@ expression: output
|
||||
│Quality Profile: Bluray-1080p │
|
||||
│Language Profile: English │
|
||||
│Monitored: Yes │
|
||||
│Size on Disk: 59.51 GB │
|
||||
│ ╭─────────────────────────────── Details ───────────────────────────────╮ │
|
||||
│ │Source Title: │ │
|
||||
│ │Event Type: unknown │ │
|
||||
│╭ Series Details ─────────────────│ │───────────────────────────────────╮│
|
||||
││ Seasons │ History │No additional data available │ ││
|
||||
││───────────────────────────────────│ │───────────────────────────────────││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────╯ ││
|
||||
│Size on Disk: 59.51 GB ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│ │Source Title: │ │
|
||||
│ │Event Type: unknown │ │
|
||||
│ │ │ │
|
||||
│╭ Series Details ─────────────│No additional data available │───────────────────────────────╮│
|
||||
││ Seasons │ History │ │ ││
|
||||
││───────────────────────────────│ │───────────────────────────────││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
+19
-19
@@ -18,25 +18,25 @@ expression: output
|
||||
│Quality Profile: Bluray-1080p │
|
||||
│Language Profile: English │
|
||||
│Monitored: Yes │
|
||||
│Size on Disk: 59.51 GB │
|
||||
│ ╭─────────────────────────────── Details ───────────────────────────────╮ │
|
||||
│ │Source Title: Test source │ │
|
||||
│ │Event Type: grabbed │ │
|
||||
│╭ Series Details ─────────────────│Indexer: │───────────────────────────────────╮│
|
||||
││ Seasons │ History │Release Group: │ ││
|
||||
││───────────────────────────────────│Series Match Type: │───────────────────────────────────││
|
||||
││ Source Title ▼ │NZB Info URL: │ Date ││
|
||||
││=> Test source │Download Client Name: │ 2024-02-10 07:28:45 UTC ││
|
||||
││ │Age: 0 days │ ││
|
||||
││ │Published Date: 1970-01-01 00:00:00 UTC │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────╯ ││
|
||||
│Size on Disk: 59.51 GB ╭─────────────────────────────────── Details ───────────────────────────────────╮ │
|
||||
│ │Source Title: Test source │ │
|
||||
│ │Event Type: grabbed │ │
|
||||
│ │Indexer: │ │
|
||||
│╭ Series Details ─────────────│Release Group: │───────────────────────────────╮│
|
||||
││ Seasons │ History │Series Match Type: │ ││
|
||||
││───────────────────────────────│NZB Info URL: │───────────────────────────────││
|
||||
││ Source Title ▼ │Download Client Name: │ Date ││
|
||||
││=> Test source │Age: 0 days │ 2024-02-10 07:28:45 UTC ││
|
||||
││ │Published Date: 1970-01-01 00:00:00 UTC │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ │ │ ││
|
||||
││ ╰─────────────────────────────────────────────────────────────────────────────────╯ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
││ ││
|
||||
|
||||
@@ -36,7 +36,7 @@ impl Size {
|
||||
Size::WideLargePrompt => (70, 50),
|
||||
Size::Message => (25, 8),
|
||||
Size::NarrowMessage => (50, 20),
|
||||
Size::NarrowLongMessage => (50, 40),
|
||||
Size::NarrowLongMessage => (50, 35),
|
||||
Size::LargeMessage => (25, 25),
|
||||
Size::InputBox => (30, 13),
|
||||
Size::Dropdown => (20, 30),
|
||||
|
||||
@@ -12,7 +12,7 @@ mod tests {
|
||||
assert_eq!(Size::WideLargePrompt.to_percent(), (70, 50));
|
||||
assert_eq!(Size::Message.to_percent(), (25, 8));
|
||||
assert_eq!(Size::NarrowMessage.to_percent(), (50, 20));
|
||||
assert_eq!(Size::NarrowLongMessage.to_percent(), (50, 40));
|
||||
assert_eq!(Size::NarrowLongMessage.to_percent(), (50, 35));
|
||||
assert_eq!(Size::LargeMessage.to_percent(), (25, 25));
|
||||
assert_eq!(Size::InputBox.to_percent(), (30, 13));
|
||||
assert_eq!(Size::Dropdown.to_percent(), (20, 30));
|
||||
|
||||
Reference in New Issue
Block a user