os-js / osjs-filemanager-application

OS.js File Manager Application

Home Page:https://manual.os-js.org/v3/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unzip option for zip files

valp124 opened this issue · comments

#30 mentions handling zip files as regular folders. How about this instead (or in addition): a right-click (and/or) menu option to unzip a zip file? Similar to the 7-zip menu:

image

(but just one button, "unzip," meaning "unzip in place" would be totally sufficient)

Thank you so much!

Hey!

This would indeed be a great feature! And should not be that hard 🤔 The best way to solve this is to add a new method to the VFS API called archive or something that could inflate/deflate etc. based on filename.

os-js/OS.js#804 would help out a great deal with this so that this feature could be enabled only for filesystems that supports it (which would be the OS.js server by default).

@ajmeese7 you might find this interesting :)

I'd be happy to give this a go! Can't promise a timeline since I'm working on several other features at the moment, but I think this is a great idea that I would also like to see implemented. Feel free to assign it to me if you'd like @andersevenrud

@andersevenrud at least until we fully have the "Select all" feature implemented on the file manager, I think it would be best to have an unarchive or extract method or something similar to indicate that it is only meant to be used in one direction. Unless you want support for compressing a single file, in which case I'm fine with the archive approach that you suggested. What are your thoughts?

The idea was just to start with support for doing extraction of single archives.

And all of archive interaction could be done with a single endpoint, i.e:

archive(archiveFile, { action: 'extract', destination: somewhere })
archive(archiveFile, { action: 'compact', files: [otherFile, ...] })
archive(archiveFile, { action: 'empty' })
archive(archiveFile, { action: 'info' })

The "select all" feature will just make it possible to do the compacting thing.

I finished implementing this for the most part a few days ago, I just need to make sure the multiselect PR's are merged before I finish up and make a PR. I have multiselect locally so I designed the archive feature with that in mind :)

This is completely done on my end, with the exception of tests. My tests are being incredibly wonky and everything with them seems to just have randomly broken, but as soon as I can get those figured out and passing again I will make the PR!

How's it going with this, folks? 😊