Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Folder download #177

Merged
merged 9 commits into from Dec 17, 2021
Merged

Folder download #177

merged 9 commits into from Dec 17, 2021

Conversation

myl7
Copy link
Collaborator

@myl7 myl7 commented Nov 22, 2021

As a draft, the PR adds some utilities for folder download, allowing one-shot access to recursive tree-like file metadata in the listing page.

Updated: The PR adds folder download support. It adds download buttons for folders in file listing page. By the download button, the folder can be downloaded as a zip with the same folder structure as it in OneDrive. It also provides utils for one-shot access to recursive tree-like file metadata.

Due to react hook limit (no conditional call or called in loop), this API does not reuse SWR cache (I tried still can not figure out how to, though SWR team is working on it), but fetches /api immediately and arranges the responses. It makes the API pretty slow (seconds for 3 level folder). However, if it is for user one-shot action like downloading a folder (#136 #143) or searching once (#151 if combined with some string similarity checking), personally speaking it is acceptable.

Folder download function impl requires some functions included in PR #169 . I will give a more complete impl if the PR is passed.

@vercel
Copy link

vercel bot commented Nov 22, 2021

Someone is attempting to deploy a commit to a Personal Account owned by @spencerwooo on Vercel.

@spencerwooo first needs to authorize it.

@vercel
Copy link

vercel bot commented Nov 27, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/spencerwoo/onedrive-vercel-index/8kRW6fFKDYsMJd2QBq6wQBw84r7p
✅ Preview: https://onedrive-vercel-index-git-fork-myl7-tree-list-spencerwoo.vercel.app

@myl7
Copy link
Collaborator Author

myl7 commented Nov 27, 2021

A complete, self(but roughly)-tested impl of folder download is available at https://github.com/myl7/onedrive-vercel-index branch folderdl. I will rebase it into the PR when possible as said above.
Demo can still be found on https://share.myl.moe .

@spencerwooo
Copy link
Owner

Now that #169 is merged, I think we can continue working on this. ;)

@spencerwooo spencerwooo added this to In progress in 🍗 MVP V1.0 Milestone via automation Dec 16, 2021
Copy link
Owner

@spencerwooo spencerwooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go, thanks for the two PRs!

@spencerwooo spencerwooo merged commit 476f241 into spencerwooo:main Dec 17, 2021
🍗 MVP V1.0 Milestone automation moved this from In progress to Done Dec 17, 2021
@myl7 myl7 deleted the tree-list branch December 17, 2021 08:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature request New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants