mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
fix(control): improve visual feedback of sync (still not finished)
This commit is contained in:
@@ -136,18 +136,21 @@ export async function add_sync_recursively(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const display_ids_without_file = file_data.short_displays_without_file.map((d) => d.id);
|
const display_ids_without_file = file_data.short_displays_without_file.map((d) => d.id);
|
||||||
await db.files_on_display
|
const new_file_loading_data: FileLoadingData = {
|
||||||
.where('file_primary_key')
|
type: 'sync_upload',
|
||||||
.equals(selected_file_id)
|
percentage: 0,
|
||||||
.filter((e) => display_ids_without_file.includes(e.display_id))
|
bytes_per_second: 0,
|
||||||
.modify({
|
seconds_until_finish: -1
|
||||||
loading_data: {
|
};
|
||||||
type: 'sync_upload',
|
const new_fods: FileOnDisplay[] = display_ids_without_file.map((display_id) => ({
|
||||||
percentage: 0,
|
display_id,
|
||||||
bytes_per_second: 0,
|
file_primary_key: selected_file_id,
|
||||||
seconds_until_finish: -1
|
date_created: new Date(),
|
||||||
}
|
loading_data: new_file_loading_data
|
||||||
});
|
}));
|
||||||
|
console.log("TEST", new_fods)
|
||||||
|
await db.files_on_display.bulkPut(new_fods);
|
||||||
|
|
||||||
await start_task_processing();
|
await start_task_processing();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,6 +269,10 @@ export async function sync(task: FileTransferTask) {
|
|||||||
}
|
}
|
||||||
await writable.close();
|
await writable.close();
|
||||||
|
|
||||||
|
await db.files_on_display.update([task.display.id, task.file_primary_key], {
|
||||||
|
loading_data: null
|
||||||
|
});
|
||||||
|
|
||||||
// 02 - send downloaded file to every destination_display
|
// 02 - send downloaded file to every destination_display
|
||||||
const temp_file = await file_handle.getFile();
|
const temp_file = await file_handle.getFile();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user