feat: Full support for deleting an artist via CLI and TUI

This commit is contained in:
2026-01-05 15:44:51 -07:00
parent bc3aeefa6e
commit 6771a0ab38
43 changed files with 1995 additions and 332 deletions
+17 -2
View File
@@ -4,8 +4,11 @@ use crate::{
handlers::{KeyEventHandler, handle_clear_errors},
matches_key,
models::{
BlockSelectionState,
lidarr_models::Artist,
servarr_data::lidarr::lidarr_data::{ActiveLidarrBlock, LIBRARY_BLOCKS},
servarr_data::lidarr::lidarr_data::{
ActiveLidarrBlock, DELETE_ARTIST_SELECTION_BLOCKS, LIBRARY_BLOCKS,
},
stateful_table::SortOption,
},
};
@@ -13,6 +16,10 @@ use crate::{
use super::handle_change_tab_left_right_keys;
use crate::handlers::table_handler::{TableHandlingConfig, handle_table};
mod delete_artist_handler;
pub(in crate::handlers::lidarr_handlers) use delete_artist_handler::DeleteArtistHandler;
#[cfg(test)]
#[path = "library_handler_tests.rs"]
mod library_handler_tests;
@@ -84,7 +91,15 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveLidarrBlock> for LibraryHandler<'a, '
fn handle_end(&mut self) {}
fn handle_delete(&mut self) {}
fn handle_delete(&mut self) {
if self.active_lidarr_block == ActiveLidarrBlock::Artists {
self
.app
.push_navigation_stack(ActiveLidarrBlock::DeleteArtistPrompt.into());
self.app.data.lidarr_data.selected_block =
BlockSelectionState::new(DELETE_ARTIST_SELECTION_BLOCKS);
}
}
fn handle_left_right_action(&mut self) {
if self.active_lidarr_block == ActiveLidarrBlock::Artists {