Add delphi integration, fix search showing plugins

This commit is contained in:
Jai A
2025-01-08 22:06:05 -08:00
parent adf3d9540d
commit 8e754cfeb5
7 changed files with 99 additions and 30 deletions

View File

@@ -31,6 +31,7 @@ use actix_web::{web, HttpRequest, HttpResponse};
use chrono::Utc;
use futures::stream::StreamExt;
use itertools::Itertools;
use log::error;
use serde::{Deserialize, Serialize};
use sqlx::postgres::PgPool;
use std::collections::{HashMap, HashSet};
@@ -980,6 +981,24 @@ pub async fn upload_file(
}
}
let url = format!("{cdn_url}/{file_path_encode}");
let client = reqwest::Client::new();
let delphi_url = dotenvy::var("DELPHI_URL")?;
let res = client
.post(delphi_url)
.json(&serde_json::json!({
"url": url,
"project_id": project_id,
"version_id": version_id,
}))
.send()
.await?;
if !res.status().is_success() {
error!("Failed to upload file to Delphi: {url}");
}
version_files.push(VersionFileBuilder {
filename: file_name.to_string(),
url: format!("{cdn_url}/{file_path_encode}"),