fix: gitea check is broken, disable check and return default true to

avoid breakage
This commit is contained in:
Aravinth Manivannan 2023-02-11 19:40:48 +05:30
parent f8d33e04e8
commit cb2dfa5e19
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
2 changed files with 3 additions and 17 deletions

View file

@ -53,6 +53,7 @@ impl<'a> From<&'a User> for AddUser<'a> {
username: u.username.as_str(),
html_link: &u.html_link,
profile_photo: u.profile_photo.as_deref(),
import: false,
}
}
}
@ -96,6 +97,7 @@ impl<'a> From<&'a Repository> for AddRepository<'a> {
tags,
html_link: &r.html_link,
website: r.website.as_deref(),
import: false,
}
}
}

View file

@ -60,23 +60,7 @@ impl PartialEq for Gitea {
#[async_trait]
impl SCForge for Gitea {
async fn is_forge(&self) -> bool {
let mut url = self.instance_url.clone();
url.set_path(GITEA_NODEINFO);
let res: serde_json::Value = self
.client
.get(url)
.send()
.await
.unwrap()
.json()
.await
.unwrap();
if let serde_json::Value::String(software) = &res["software"]["name"] {
software == GITEA_IDENTIFIER
} else {
false
}
true
}
fn get_url(&self) -> &Url {