Full popup description functionality

This commit is contained in:
2023-08-08 10:50:04 -06:00
parent b24e0cdccd
commit ec980ea32c
11 changed files with 146 additions and 58 deletions
+4 -4
View File
@@ -10,20 +10,20 @@ pub async fn parse_response<T: DeserializeOwned>(response: Response) -> Result<T
pub fn get_movie_status(
has_file: bool,
downloads_vec: &Vec<DownloadRecord>,
downloads_vec: &[DownloadRecord],
movie_id: Number,
) -> String {
if !has_file {
if let Some(download) = downloads_vec
.iter()
.find(|&download| download.movie_id == movie_id)
.find(|&download| download.movie_id.as_u64().unwrap() == movie_id.as_u64().unwrap())
{
if download.status == "downloading" {
return "Downloading".to_owned();
}
return "Missing".to_owned();
}
return "Missing".to_owned();
}
"Downloaded".to_owned()