Added two new checkboxes to the delete movie UI that allows users to specify to delete the file and/or add an exclusion for the selected film on deletion. Also fixed the refresh bug in the root folders UI where you have to manually refresh to get the changes to show before 20 seconds. Also cleaned up code a bit and removed some unnecessary clone calls and references-dereferences since the types were copyable and not necessary to be referenced since they were all dereferenced anyway and copied. Made sense to just cut out the middleman on the copies.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
use tui::backend::Backend;
|
||||
use tui::layout::Rect;
|
||||
use tui::Frame;
|
||||
|
||||
use crate::app::radarr::ActiveRadarrBlock;
|
||||
use crate::app::App;
|
||||
use crate::models::Route;
|
||||
use crate::ui::draw_prompt_box_with_checkboxes;
|
||||
|
||||
pub(super) fn draw_delete_movie_prompt<B: Backend>(
|
||||
f: &mut Frame<'_, B>,
|
||||
app: &mut App,
|
||||
prompt_area: Rect,
|
||||
) {
|
||||
if matches!(
|
||||
*app.get_current_route(),
|
||||
Route::Radarr(ActiveRadarrBlock::DeleteMoviePrompt, _)
|
||||
) {
|
||||
let selected_block = app.data.radarr_data.selected_block;
|
||||
draw_prompt_box_with_checkboxes(
|
||||
f,
|
||||
prompt_area,
|
||||
"Delete Movie",
|
||||
format!(
|
||||
"Do you really want to delete: {}?",
|
||||
app.data.radarr_data.movies.current_selection().title
|
||||
)
|
||||
.as_str(),
|
||||
vec![
|
||||
(
|
||||
"Delete Movie Files",
|
||||
app.data.radarr_data.delete_movie_files,
|
||||
selected_block == ActiveRadarrBlock::DeleteMovieToggleDeleteFile,
|
||||
),
|
||||
(
|
||||
"Add List Exclusion",
|
||||
app.data.radarr_data.add_list_exclusion,
|
||||
selected_block == ActiveRadarrBlock::DeleteMovieToggleAddListExclusion,
|
||||
),
|
||||
],
|
||||
selected_block == ActiveRadarrBlock::DeleteMovieConfirmPrompt,
|
||||
app.data.radarr_data.prompt_confirm,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user