Open YDX-2147483647 opened 1 year ago
When downloading multiple files, Send concatenates all files into a raw stream. This PR checks the files manifest, and split the stream back to normal files.
https://github.com/timvisee/ffsend/issues/134#issuecomment-1740348270
If we are downloading multiple files (if metadata.mime() == "send-archive"):
if metadata.mime() == "send-archive"
fn split(archive: File, files: Vec<ManifestFile>)
Replace extract: bool with enum InvokeStrategy
extract: bool
enum InvokeStrategy
Replace file: bool of prepare_path() with strategy: &InvokeStrategy
file: bool
prepare_path()
strategy: &InvokeStrategy
[!NOTE] When archive feature is dropped, output_dir (file) should be true. I guess there was a mistake when introducing the archive feature. https://github.com/timvisee/ffsend/blob/238f1f54d7bde88c0e525dd0d5c4c6aa251a3634/src/action/download.rs#L123-L134
[!NOTE]
When archive feature is dropped, output_dir (file) should be true. I guess there was a mistake when introducing the archive feature.
output_dir
file
true
https://github.com/timvisee/ffsend/blob/238f1f54d7bde88c0e525dd0d5c4c6aa251a3634/src/action/download.rs#L123-L134
Expose manifest and its files from metadata API: https://github.com/timvisee/ffsend-api/pull/82
SplitError, its From trait, etc.
SplitError
From
Resolves #134
Please merge https://github.com/timvisee/ffsend-api/pull/82 first if you want to merge this PR.
When downloading multiple files, Send concatenates all files into a raw stream. This PR checks the files manifest, and split the stream back to normal files.
Technical details
Research about the sever side
https://github.com/timvisee/ffsend/issues/134#issuecomment-1740348270
Implementation
If we are downloading multiple files (
if metadata.mime() == "send-archive"
):fn split(archive: File, files: Vec<ManifestFile>)
)Other changes
Replace
extract: bool
withenum InvokeStrategy
Replace
file: bool
ofprepare_path()
withstrategy: &InvokeStrategy
Expose manifest and its files from metadata API: https://github.com/timvisee/ffsend-api/pull/82
SplitError
, itsFrom
trait, etc.Additional information
Resolves #134
Please merge https://github.com/timvisee/ffsend-api/pull/82 first if you want to merge this PR.