Skip to content

Commit

Permalink
cleanup progress handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Jan 26, 2025
1 parent 0970eb5 commit f2289ae
Show file tree
Hide file tree
Showing 15 changed files with 900 additions and 1,413 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ pnpm-lock.yaml
native-deps*
apps/storybook/storybook-static
tauri.*.conf.json

*.tsbuildinfo
4 changes: 3 additions & 1 deletion apps/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ window {}:
RequestedFormatType::AbsoluteHighestFrameRate,
);

let mut camera = Camera::new(camera_info.index().clone(), format).unwrap();
let Ok(mut camera) = Camera::new(camera_info.index().clone(), format) else {
continue;
};

info.push(json!({
"index": camera_info.index().to_string(),
Expand Down
3 changes: 0 additions & 3 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,6 @@ fn open_main_window(app: AppHandle) {

#[derive(Serialize, Type, tauri_specta::Event, Debug, Clone)]
pub struct UploadProgress {
stage: String,
progress: f64,
message: String,
}
Expand Down Expand Up @@ -1233,7 +1232,6 @@ async fn upload_exported_video(

// Start upload progress
UploadProgress {
stage: "uploading".to_string(),
progress: 0.0,
message: "Starting upload...".to_string(),
}
Expand Down Expand Up @@ -1265,7 +1263,6 @@ async fn upload_exported_video(
Ok(uploaded_video) => {
// Emit upload complete
UploadProgress {
stage: "uploading".to_string(),
progress: 1.0,
message: "Upload complete!".to_string(),
}
Expand Down
2 changes: 0 additions & 2 deletions apps/desktop/src-tauri/src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ pub async fn upload_video(

// Emit progress every chunk
UploadProgress {
stage: "uploading".to_string(),
progress: current / total_size,
message: format!("{:.0}%", (current / total_size * 100.0)),
}
Expand Down Expand Up @@ -289,7 +288,6 @@ pub async fn upload_video(
if response.status().is_success() {
// Final progress update
UploadProgress {
stage: "uploading".to_string(),
progress: 1.0,
message: "100%".to_string(),
}
Expand Down
Loading

1 comment on commit f2289ae

@vercel
Copy link

@vercel vercel bot commented on f2289ae Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.