Skip to content
Merged
185 changes: 185 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ tauri-plugin-sentry = "0.5.0"
thiserror.workspace = true
bytes = "1.10.1"
async-stream = "0.3.6"
tracing-futures = { version = "0.2.5", features = ["futures-03"] }
tracing-opentelemetry = "0.32.0"
opentelemetry = "0.31.0"
opentelemetry-otlp = "0.31.0" #{ version = , features = ["http-proto", "reqwest-client"] }
opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio", "trace"] }


[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = "0.24.0"
Expand Down
12 changes: 9 additions & 3 deletions apps/desktop/src-tauri/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
use serde::{Deserialize, Serialize};
use serde_json::json;
use tauri::AppHandle;
use tracing::instrument;

use crate::web_api::{AuthedApiError, ManagerExt};

#[instrument]
pub async fn upload_multipart_initiate(
app: &AppHandle,
video_id: &str,
Expand Down Expand Up @@ -44,6 +46,7 @@ pub async fn upload_multipart_initiate(
.map(|data| data.upload_id)
}

#[instrument]
pub async fn upload_multipart_presign_part(
app: &AppHandle,
video_id: &str,
Expand Down Expand Up @@ -86,7 +89,7 @@ pub async fn upload_multipart_presign_part(
.map(|data| data.presigned_url)
}

#[derive(Serialize)]
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct UploadedPart {
pub part_number: u32,
Expand All @@ -107,6 +110,7 @@ pub struct S3VideoMeta {
pub fps: Option<f32>,
}

#[instrument]
pub async fn upload_multipart_complete(
app: &AppHandle,
video_id: &str,
Expand Down Expand Up @@ -158,15 +162,15 @@ pub async fn upload_multipart_complete(
.map(|data| data.location)
}

#[derive(Serialize)]
#[derive(Debug, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum PresignedS3PutRequestMethod {
#[allow(unused)]
Post,
Put,
}

#[derive(Serialize)]
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PresignedS3PutRequest {
pub video_id: String,
Expand All @@ -176,6 +180,7 @@ pub struct PresignedS3PutRequest {
pub meta: Option<S3VideoMeta>,
}

#[instrument(skip())]
pub async fn upload_signed(
app: &AppHandle,
body: PresignedS3PutRequest,
Expand Down Expand Up @@ -213,6 +218,7 @@ pub async fn upload_signed(
.map(|data| data.presigned_put_data.url)
}

#[instrument]
pub async fn desktop_video_progress(
app: &AppHandle,
video_id: &str,
Expand Down
Loading
Loading