MCPcopy Create free account
hub / github.com/error311/FileRise / uploadItem

Function uploadItem

public/js/sharedDropView.js:550–564  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

548 }
549
550 async function uploadItem(item) {
551 const validationMsg = validateQueueItem(item);
552 if (validationMsg) {
553 setItemStatus(item, 'error', 0, validationMsg);
554 return;
555 }
556
557 setItemStatus(item, 'uploading', 0, tx('share_uploading_progress', { pct: 0 }, 'Uploading 0%'));
558 if (item.file.size >= CHUNK_THRESHOLD && item.file.size > CHUNK_SIZE) {
559 await uploadChunked(item);
560 } else {
561 await uploadSingle(item);
562 }
563 setItemStatus(item, 'done', 100, tx('share_drop_status_uploaded', null, 'Uploaded'));
564 }
565
566 function runQueue() {
567 while (running < MAX_CONCURRENT) {

Callers 1

runQueueFunction · 0.85

Calls 5

validateQueueItemFunction · 0.85
setItemStatusFunction · 0.85
uploadChunkedFunction · 0.85
uploadSingleFunction · 0.85
txFunction · 0.70

Tested by

no test coverage detected