feat(dl): keep failed track segments across runs in a resume stash

Stash a failed or cancelled track's segments outside the task temp dir and restore them on the next download. Also drop a pre-sized data file with its .!dev control file.
This commit is contained in:
imSp4rky
2026-10-20 19:53:42 -06:00
parent 5b9120a7f1
commit f2273b8e97
4 changed files with 337 additions and 1 deletions
+5
View File
@@ -112,6 +112,11 @@ dl:
Keep a failed download's completed segment files so the next download resumes from where it
stopped instead of restarting from byte zero.
unshackle keeps the segments of a failed track in a `resume` directory inside the temp
directory, and the next download of the same track takes them back from there. It removes a
kept entry after 7 days, and `unshackle env clear temp` removes them all. A process that is
killed, or a job cancelled over the REST API, keeps nothing.
unshackle reuses only whole, fully downloaded segments. It always discards partially written
segments, and no partial-byte (`Range`) resume across runs takes place. Reuse is possible only
with proof that the segmentation did not change. The manifest URL, segment count, and byte