fix: gitea check is broken, disable check and return default true to
avoid breakage
This commit is contained in:
parent
f8d33e04e8
commit
cb2dfa5e19
2 changed files with 3 additions and 17 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue