style: Applied uniform formatting across all new Lidarr files

This commit is contained in:
2026-01-05 15:46:16 -07:00
parent 6771a0ab38
commit 059fa48bd9
26 changed files with 90 additions and 99 deletions
+9 -9
View File
@@ -9,23 +9,23 @@ mod tests {
use rstest::rstest;
use tokio_util::sync::CancellationToken;
use crate::app::App;
use crate::app::context_clues::SERVARR_CONTEXT_CLUES;
use crate::app::key_binding::{KeyBinding, DEFAULT_KEYBINDINGS};
use crate::app::key_binding::{DEFAULT_KEYBINDINGS, KeyBinding};
use crate::app::radarr::radarr_context_clues::{
LIBRARY_CONTEXT_CLUES, MOVIE_DETAILS_CONTEXT_CLUES,
};
use crate::app::App;
use crate::event::Key;
use crate::handlers::{handle_clear_errors, handle_prompt_toggle};
use crate::handlers::{handle_events, populate_keymapping_table};
use crate::models::HorizontallyScrollableText;
use crate::models::Route;
use crate::models::servarr_data::ActiveKeybindingBlock;
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, RadarrData};
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
use crate::models::servarr_data::ActiveKeybindingBlock;
use crate::models::servarr_models::KeybindingItem;
use crate::models::stateful_table::StatefulTable;
use crate::models::HorizontallyScrollableText;
use crate::models::Route;
#[test]
fn test_handle_clear_errors() {
@@ -128,8 +128,8 @@ mod tests {
}
#[test]
fn test_handle_empties_keybindings_table_on_help_button_press_when_keybindings_table_is_already_populated(
) {
fn test_handle_empties_keybindings_table_on_help_button_press_when_keybindings_table_is_already_populated()
{
let mut app = App::test_default();
let keybinding_items = Vec::from(SERVARR_CONTEXT_CLUES)
.iter()
@@ -260,8 +260,8 @@ mod tests {
}
#[test]
fn test_populate_keymapping_table_populates_delegated_servarr_context_provider_options_before_global_options(
) {
fn test_populate_keymapping_table_populates_delegated_servarr_context_provider_options_before_global_options()
{
let mut expected_keybinding_items = MOVIE_DETAILS_CONTEXT_CLUES
.iter()
.map(|(key, desc)| context_clue_to_keybinding_item(key, desc))
@@ -6,8 +6,8 @@ mod tests {
use serde_json::Number;
use strum::IntoEnumIterator;
use crate::handlers::lidarr_handlers::library::{LibraryHandler, artists_sorting_options};
use crate::handlers::KeyEventHandler;
use crate::handlers::lidarr_handlers::library::{LibraryHandler, artists_sorting_options};
use crate::models::lidarr_models::{Artist, ArtistStatistics, ArtistStatus};
use crate::models::servarr_data::lidarr::lidarr_data::{ActiveLidarrBlock, LIBRARY_BLOCKS};
+9 -10
View File
@@ -33,16 +33,15 @@ pub(super) struct LibraryHandler<'a, 'b> {
impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveLidarrBlock> for LibraryHandler<'a, 'b> {
fn handle(&mut self) {
let artists_table_handling_config =
TableHandlingConfig::new(ActiveLidarrBlock::Artists.into())
.sorting_block(ActiveLidarrBlock::ArtistsSortPrompt.into())
.sort_options(artists_sorting_options())
.searching_block(ActiveLidarrBlock::SearchArtists.into())
.search_error_block(ActiveLidarrBlock::SearchArtistsError.into())
.search_field_fn(|artist| &artist.artist_name.text)
.filtering_block(ActiveLidarrBlock::FilterArtists.into())
.filter_error_block(ActiveLidarrBlock::FilterArtistsError.into())
.filter_field_fn(|artist| &artist.artist_name.text);
let artists_table_handling_config = TableHandlingConfig::new(ActiveLidarrBlock::Artists.into())
.sorting_block(ActiveLidarrBlock::ArtistsSortPrompt.into())
.sort_options(artists_sorting_options())
.searching_block(ActiveLidarrBlock::SearchArtists.into())
.search_error_block(ActiveLidarrBlock::SearchArtistsError.into())
.search_field_fn(|artist| &artist.artist_name.text)
.filtering_block(ActiveLidarrBlock::FilterArtists.into())
.filter_error_block(ActiveLidarrBlock::FilterArtistsError.into())
.filter_field_fn(|artist| &artist.artist_name.text);
if !handle_table(
self,