Added delete download functionality
This commit is contained in:
+24
-1
@@ -92,6 +92,15 @@ pub(super) fn draw_radarr_ui<B: Backend>(f: &mut Frame<'_, B>, app: &mut App, ar
|
||||
30,
|
||||
30,
|
||||
),
|
||||
ActiveRadarrBlock::DeleteDownloadPrompt => draw_popup_over(
|
||||
f,
|
||||
app,
|
||||
content_rect,
|
||||
draw_downloads,
|
||||
draw_delete_download_prompt,
|
||||
30,
|
||||
30,
|
||||
),
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
@@ -179,6 +188,20 @@ fn draw_delete_movie_prompt<B: Backend>(f: &mut Frame<'_, B>, app: &mut App, pro
|
||||
);
|
||||
}
|
||||
|
||||
fn draw_delete_download_prompt<B: Backend>(f: &mut Frame<'_, B>, app: &mut App, prompt_area: Rect) {
|
||||
draw_prompt_box(
|
||||
f,
|
||||
prompt_area,
|
||||
" Confirm Cancel Download? ",
|
||||
format!(
|
||||
"Do you really want to delete this download: {}?",
|
||||
app.data.radarr_data.downloads.current_selection().title
|
||||
)
|
||||
.as_str(),
|
||||
&app.data.radarr_data.prompt_confirm,
|
||||
);
|
||||
}
|
||||
|
||||
fn draw_search_box<B: Backend>(f: &mut Frame<'_, B>, app: &mut App, area: Rect) {
|
||||
let chunks = vertical_chunks_with_margin(vec![Constraint::Length(3)], area, 1);
|
||||
if !app.data.radarr_data.is_searching {
|
||||
@@ -446,7 +469,7 @@ fn determine_row_style(downloads_vec: &[DownloadRecord], movie: &Movie) -> Style
|
||||
if !movie.has_file {
|
||||
if let Some(download) = downloads_vec
|
||||
.iter()
|
||||
.find(|&download| download.movie_id == movie.id)
|
||||
.find(|&download| download.id == movie.id)
|
||||
{
|
||||
if download.status == "downloading" {
|
||||
return style_warning();
|
||||
|
||||
Reference in New Issue
Block a user