diff --git a/src/crawl.rs b/src/crawl.rs index f522c71..7d2ad39 100644 --- a/src/crawl.rs +++ b/src/crawl.rs @@ -120,10 +120,18 @@ async fn fetch_instance_details(domain: &str) -> Result } } - let linked_instances = site_info + let require_application = site_info + .site_view + .site + .require_application + .unwrap_or(false); + let linked_instances: Vec = site_info .federated_instances .map(|f| f.linked) - .unwrap_or_default(); + .unwrap_or_default() + .iter() + .map(|l| l.to_lowercase()) + .collect(); Ok(InstanceDetails { domain: domain.to_owned(), name: site_info.site_view.site.name, @@ -136,7 +144,7 @@ async fn fetch_instance_details(domain: &str) -> Result users_active_month: node_info.usage.users.active_month, open_registrations: node_info.open_registrations, linked_instances_count: linked_instances.len() as i32, - require_application: site_info.site_view.site.require_application.unwrap_or(false), + require_application, linked_instances, }) } diff --git a/src/federated_instances.rs b/src/federated_instances.rs index f1102a4..7ed1c12 100644 --- a/src/federated_instances.rs +++ b/src/federated_instances.rs @@ -24,5 +24,5 @@ pub struct Site { pub name: String, pub icon: Option, pub description: Option, - pub require_application: Option + pub require_application: Option, }