@@ -520,7 +520,7 @@ fn ycbcr_to_rgb(y: u8, cb: u8, cr: u8, range: Nv12Range) -> (u8, u8, u8) {
520520
521521#[ cfg( target_os = "macos" ) ]
522522fn clamp_channel ( value : f32 ) -> u8 {
523- value. max ( 0.0 ) . min ( 255.0 ) as u8
523+ value. clamp ( 0.0 , 255.0 ) as u8
524524}
525525
526526#[ cfg( target_os = "macos" ) ]
@@ -929,15 +929,15 @@ async fn capture_window_thumbnail(window: &scap_targets::Window) -> Option<Strin
929929#[ tauri:: command( async ) ]
930930#[ specta:: specta]
931931pub async fn list_displays_with_thumbnails ( ) -> Result < Vec < CaptureDisplayWithThumbnail > , String > {
932- tokio:: task:: spawn_blocking ( || collect_displays_with_thumbnails ( ) )
932+ tokio:: task:: spawn_blocking ( collect_displays_with_thumbnails)
933933 . await
934934 . map_err ( |err| err. to_string ( ) ) ?
935935}
936936
937937#[ tauri:: command( async ) ]
938938#[ specta:: specta]
939939pub async fn list_windows_with_thumbnails ( ) -> Result < Vec < CaptureWindowWithThumbnail > , String > {
940- tokio:: task:: spawn_blocking ( || collect_windows_with_thumbnails ( ) )
940+ tokio:: task:: spawn_blocking ( collect_windows_with_thumbnails)
941941 . await
942942 . map_err ( |err| err. to_string ( ) ) ?
943943}
@@ -1681,35 +1681,30 @@ async fn handle_recording_finish(
16811681 } )
16821682 . ok ( ) ;
16831683 }
1684- } else {
1685- if let Ok ( meta) = build_video_meta ( & output_path)
1686- . map_err ( |err| error ! ( "Error getting video metadata: {}" , err) )
1687- {
1688- // The upload_video function handles screenshot upload, so we can pass it along
1689- upload_video (
1690- & app,
1691- video_upload_info. id . clone ( ) ,
1692- output_path,
1693- display_screenshot. clone ( ) ,
1694- meta,
1695- None ,
1696- )
1697- . await
1698- . map ( |_| {
1699- info ! ( "Final video upload with screenshot completed successfully" )
1700- } )
1701- . map_err ( |error| {
1702- error ! ( "Error in upload_video: {error}" ) ;
1703-
1704- let mut meta =
1705- RecordingMeta :: load_for_project ( & recording_dir) . unwrap ( ) ;
1706- meta. upload = Some ( UploadMeta :: Failed { error } ) ;
1707- meta. save_for_project ( )
1708- . map_err ( |e| format ! ( "Failed to save recording meta: {e}" ) )
1709- . ok ( ) ;
1710- } )
1711- . ok ( ) ;
1712- }
1684+ } else if let Ok ( meta) = build_video_meta ( & output_path)
1685+ . map_err ( |err| error ! ( "Error getting video metadata: {}" , err) )
1686+ {
1687+ // The upload_video function handles screenshot upload, so we can pass it along
1688+ upload_video (
1689+ & app,
1690+ video_upload_info. id . clone ( ) ,
1691+ output_path,
1692+ display_screenshot. clone ( ) ,
1693+ meta,
1694+ None ,
1695+ )
1696+ . await
1697+ . map ( |_| info ! ( "Final video upload with screenshot completed successfully" ) )
1698+ . map_err ( |error| {
1699+ error ! ( "Error in upload_video: {error}" ) ;
1700+
1701+ let mut meta = RecordingMeta :: load_for_project ( & recording_dir) . unwrap ( ) ;
1702+ meta. upload = Some ( UploadMeta :: Failed { error } ) ;
1703+ meta. save_for_project ( )
1704+ . map_err ( |e| format ! ( "Failed to save recording meta: {e}" ) )
1705+ . ok ( ) ;
1706+ } )
1707+ . ok ( ) ;
17131708 }
17141709 }
17151710 } ) ;
@@ -1902,11 +1897,11 @@ fn generate_zoom_segments_from_clicks_impl(
19021897
19031898 let mut merged: Vec < ( f64 , f64 ) > = Vec :: new ( ) ;
19041899 for interval in intervals {
1905- if let Some ( last) = merged. last_mut ( ) {
1906- if interval. 0 <= last. 1 + MERGE_GAP_THRESHOLD {
1907- last . 1 = last . 1 . max ( interval . 1 ) ;
1908- continue ;
1909- }
1900+ if let Some ( last) = merged. last_mut ( )
1901+ && interval. 0 <= last. 1 + MERGE_GAP_THRESHOLD
1902+ {
1903+ last . 1 = last . 1 . max ( interval . 1 ) ;
1904+ continue ;
19101905 }
19111906 merged. push ( interval) ;
19121907 }
0 commit comments