Added the full Radarr CLI so users can programmatically access all the same management features as in the TUI

This commit is contained in:
2024-10-29 18:47:40 -06:00
parent 217d3242a8
commit 1f8d72c939
65 changed files with 9401 additions and 1370 deletions
@@ -416,6 +416,8 @@ mod tests {
}
mod test_handle_home_end {
use std::sync::atomic::Ordering;
use strum::IntoEnumIterator;
use crate::extended_stateful_iterable_vec;
@@ -769,14 +771,14 @@ mod tests {
.handle();
assert_eq!(
*app
app
.data
.radarr_data
.add_movie_search
.as_ref()
.unwrap()
.offset
.borrow(),
.load(Ordering::SeqCst),
4
);
@@ -789,14 +791,14 @@ mod tests {
.handle();
assert_eq!(
*app
app
.data
.radarr_data
.add_movie_search
.as_ref()
.unwrap()
.offset
.borrow(),
.load(Ordering::SeqCst),
0
);
}
@@ -818,7 +820,7 @@ mod tests {
.handle();
assert_eq!(
*app
app
.data
.radarr_data
.add_movie_modal
@@ -826,7 +828,7 @@ mod tests {
.unwrap()
.tags
.offset
.borrow(),
.load(Ordering::SeqCst),
4
);
@@ -839,7 +841,7 @@ mod tests {
.handle();
assert_eq!(
*app
app
.data
.radarr_data
.add_movie_modal
@@ -847,13 +849,15 @@ mod tests {
.unwrap()
.tags
.offset
.borrow(),
.load(Ordering::SeqCst),
0
);
}
}
mod test_handle_left_right_action {
use std::sync::atomic::Ordering;
use crate::models::servarr_data::radarr::modals::AddMovieModal;
use rstest::rstest;
@@ -886,14 +890,14 @@ mod tests {
.handle();
assert_eq!(
*app
app
.data
.radarr_data
.add_movie_search
.as_ref()
.unwrap()
.offset
.borrow(),
.load(Ordering::SeqCst),
1
);
@@ -906,14 +910,14 @@ mod tests {
.handle();
assert_eq!(
*app
app
.data
.radarr_data
.add_movie_search
.as_ref()
.unwrap()
.offset
.borrow(),
.load(Ordering::SeqCst),
0
);
}
@@ -935,7 +939,7 @@ mod tests {
.handle();
assert_eq!(
*app
app
.data
.radarr_data
.add_movie_modal
@@ -943,7 +947,7 @@ mod tests {
.unwrap()
.tags
.offset
.borrow(),
.load(Ordering::SeqCst),
1
);
@@ -956,7 +960,7 @@ mod tests {
.handle();
assert_eq!(
*app
app
.data
.radarr_data
.add_movie_modal
@@ -964,7 +968,7 @@ mod tests {
.unwrap()
.tags
.offset
.borrow(),
.load(Ordering::SeqCst),
0
);
}
@@ -1211,7 +1215,7 @@ mod tests {
assert_eq!(app.get_current_route(), &ActiveRadarrBlock::Movies.into());
assert_eq!(
app.data.radarr_data.prompt_confirm_action,
Some(RadarrEvent::AddMovie)
Some(RadarrEvent::AddMovie(None))
);
assert!(app.data.radarr_data.add_movie_modal.is_some());
}