Functional tags implementation for adding movies! Still need to fix weird loading bug when searching a movie that shows an error too soon before results are loaded, need to fix the horizontal scrolling issue, and I need to change the quality profile map to use the BiMap

This commit is contained in:
2023-08-08 10:50:05 -06:00
parent a23fc84d5b
commit c946d916ad
10 changed files with 226 additions and 42 deletions
+21 -3
View File
@@ -794,7 +794,7 @@ impl<'a> Network<'a> {
.await;
self
.handle_request::<AddMovieBody, ()>(request_props, |_, _| ())
.handle_request::<AddMovieBody, Value>(request_props, |_, _| ())
.await;
}
@@ -921,7 +921,6 @@ impl<'a> Network<'a> {
.clone();
let missing_tags_vec = edit_tags
.split(',')
.into_iter()
.filter(|&tag| !tag.is_empty() && tags_map.get_by_right(tag.trim()).is_none())
.collect::<Vec<&str>>();
@@ -936,7 +935,6 @@ impl<'a> Network<'a> {
.edit_tags
.text
.split(',')
.into_iter()
.filter(|tag| !tag.is_empty())
.map(|tag| {
*app
@@ -1028,6 +1026,10 @@ fn get_movie_status(has_file: bool, downloads_vec: &[DownloadRecord], movie_id:
if download.status == "downloading" {
return "Downloading".to_owned();
}
if download.status == "completed" {
return "Awaiting Import".to_owned();
}
}
return "Missing".to_owned();
@@ -2399,6 +2401,22 @@ mod test {
);
}
#[test]
fn test_get_movie_status_awaiting_import() {
assert_str_eq!(
get_movie_status(
false,
&[DownloadRecord {
movie_id: 1.into(),
status: "completed".to_owned(),
..DownloadRecord::default()
}],
1.into()
),
"Awaiting Import"
);
}
async fn mock_radarr_api(
method: RequestMethod,
request_body: Option<Value>,