lagrange icon indicating copy to clipboard operation
lagrange copied to clipboard

Make directory hierarchy based on URL when downloading a page; organized cache

Open Arteneko opened this issue 2 years ago • 2 comments

Right now, if you ask to download a gemini page using the right-click "Save to downloads" option, it saves the base file as-is. If two pages are saved with the same name, it'll conflict/overwrite.

For quick page saving, this is enough, but it isn't really the case for when you start archiving pages to keep them offline.

Would it be possible to have a "download" that would create nested folders as per the URL ?

For example, for gemini://git.skyjake.fi/lagrange/release/res/about/help.gmi, instead of saving it in help.gmi, to save it in git.skyjake.fi/lagrange/releases/res/about/help.gmi ?

That would make archiving a lot easier.

If that doesn't fit with your goals for the download action, would you be open for a proposal to integrate something to easily archive and "re-use offline version" of pages ?

Arteneko avatar Jun 11 '22 03:06 Arteneko

The intended behavior here is to always append a date/time string at the end of the file name if there is a duplicate. This doesn't appear to be the case when using "Download Linked File", which seems like a bug.

Would it be possible to have a "download" that would create nested folders as per the URL ?

I don't think this makes sense for the download action, and Lagrange isn't meant to be an archiving tool... I don't think it makes much sense to build an archiving tool into the app. Better to use utilities specifically built for this purpose, e.g.: gemini://gemini.bortzmeyer.org/software/agunua/geminitrack.gmi

Lagrange currently caches 50 of the most recently visited pages of each tab and those can be navigated freely back/forward without any new network requests (so, also off-line). A more persistent cache organized and navigable by domain might be useful, but that requires a bit more thinking.

skyjake avatar Jun 13 '22 12:06 skyjake

An organized cache would be quite interesting, yes... Do you have any first-look thoughts about it ?

Arteneko avatar Jun 13 '22 13:06 Arteneko