You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let use_md5_hashes = app.is_server_url_custom().await;
597
+
598
+
letmut stream = pin!(stream);
597
599
letmut prev_part_number = None;
598
600
letmut expected_part_number = 1u32;
599
601
600
602
loop{
601
-
let(Some(item), presigned_url) = join(
602
-
stream.next(),
603
-
// We generate the presigned URL ahead of time for the part we expect to come next.
604
-
// If it's not the chunk that actually comes next we just throw it out.
605
-
// This means if the filesystem takes a while for the recording to reach previous total + CHUNK_SIZE, which is the common case, we aren't just doing nothing.
let(item,mut presigned_url, md5_sum) = if use_md5_hashes {
604
+
letSome(item) = stream.next().await else {
605
+
break;
606
+
};
607
+
let item = item.map_err(|err| format!("uploader/part/{:?}/fs: {err:?}", prev_part_number.map(|p| p + 1)))?;
608
+
let md5_sum = base64::encode(md5::compute(&item.chunk).0);
609
+
let presigned_url = api::upload_multipart_presign_part(&app,&video_id,&upload_id, expected_part_number,Some(
610
+
&md5_sum
611
+
)).await?;
612
+
613
+
(item, presigned_url,Some(md5_sum))
614
+
} else {
615
+
let(Some(item), presigned_url) = join(
616
+
stream.next(),
617
+
// We generate the presigned URL ahead of time for the part we expect to come next.
618
+
// If it's not the chunk that actually comes next we just throw it out.
619
+
// This means if the filesystem takes a while for the recording to reach previous total + CHUNK_SIZE, which is the common case, we aren't just doing nothing.
0 commit comments