Transfer saved songs directly between paired devices with resumable OPFS writes

This commit is contained in:
Jonathan Sykes
2026-10-03 20:32:45 +08:00
parent 88e2e67eeb
commit 08ff8398b5
10 changed files with 253 additions and 1 deletions

View File

@@ -285,7 +285,7 @@
// and only for the exact cid this device holds.
let restoring = false;
onMessage('upload-request', async (m) => {
if (restoring || hooks.getSettings().p2pShare === false) return;
if (restoring || hooks.getSettings().p2pShare === false || hooks.getSettings().directTransfer !== false) return;
const rec = window.DeviceDB ? await window.DeviceDB.getFile(m.videoId) : null;
if (!rec || rec.cid !== m.cid) return;
restoring = true;