Fix some issues with search and mod creation (#77)

This commit is contained in:
Aeledfyr
2020-10-16 12:04:38 -05:00
committed by GitHub
parent 77d35b61a9
commit 7983e82b60
4 changed files with 71 additions and 34 deletions

View File

@@ -186,12 +186,15 @@ pub async fn index_curseforge(
.date_modified
.parse::<chrono::DateTime<chrono::Utc>>()?;
let mut author = String::new();
let mut author_url = String::new();
let author;
let author_url;
if curseforge_mod.authors.len() > 0 {
author = (&curseforge_mod.authors[0].name).to_string();
author_url = (&curseforge_mod.authors[0].url).to_string();
if let Some(user) = curseforge_mod.authors.get(0) {
author = user.name.clone();
author_url = user.url.clone();
} else {
author = String::from("unknown");
author_url = curseforge_mod.website_url.clone();
}
docs_to_add.push(UploadSearchMod {