rotdrop / nextcloud-app-files-archive

Archive inspection and extraction as Nextcloud app.
Other
9 stars 4 forks source link

Mount while there is already an existing folder with same name #4

Closed TtuxX closed 1 year ago

TtuxX commented 1 year ago

Hi there,

I ran into a strange issue while testing issue N°2, where I mounted an archive "B" inside a folder "A" that contained an existing folder with name "B" (minus the .zip end of course).

As a result, the original folder, which was shared to external users, was visually replaced by the mounted one.

Would it be possible to make NC files interface display the two folders with a same name but with different icons ? Or add a specific text tag in at the beginning of the mounted folder to differenciate it ? Like "[MOUNT] - Original Archive Name Here"

Thank you very much.

rotdrop commented 1 year ago

Hi there,

I ran into a strange issue while testing issue N°2, where I mounted an archive "B" inside a folder "A" that contained an existing folder with name "B" (minus the .zip end of course).

As a result, the original folder, which was shared to external users, was visually replaced by the mounted one.

Would it be possible to make NC files interface display the two folders with a same name but with different icons ?

No, the file-system path is unique, it cannot occur twice.

Or add a specific text tag in at the beginning of the mounted folder to differenciate it ? Like "[MOUNT] - Original Archive Name Here"

Actually, I would prefer to perhaps automatically append a sequence number, as this is the way the core NC fs handles conflicts, so the automatically generated mount would be FOLDERNAME (2) etc.

It is already possible in the side-bar menu to choose a different mount-path name (even outside the current directory)

One could make the mount-tag a user configurable option, kind of a template, which would then be the folder-name chosen in the actions menu and the default mount-point in the side-bar menu.

Having this done, we consequently should also add an equivalent option to the target for archive extraction.

So in summary: yes, this is an issue.

rotdrop commented 1 year ago

This should be fixed by v1.0.3-rc1:

https://github.com/rotdrop/nextcloud-app-files-archive/blob/v1.0.3-rc1/CHANGELOG.md

TtuxX commented 1 year ago

Really awesome, it appears to work really well, thanks! :)

I just have one small issue when there are spaces in the file name:

image

rotdrop commented 1 year ago

The problems are not the spaces but the dots. In order to strip double extensions like .tar.gz I just pathinfo(PATHINFO_FILENAME) two times. Personally I would probably not name my files the way you did, so these case were not on my mind.

rotdrop commented 1 year ago

Can you please check if

2d4fabfdf1ba0c8db9432583fb7d01285a80c261

fixes the problem? Thanks!

rotdrop commented 1 year ago

I am closing this as resolved. Feel free to reopen if the problem remains in the current version.

TtuxX commented 1 year ago

It works great with the new version. Thanks again ! :)

Maybe UI could be improved/softened a bit as it throws a "frightening" error at the end-user when there is a folder/mount name conflict and auto folder renaming has not been enabled by the Administrator:

Bad Request The mount point "/XXXX" already exists and auto-rename is not enabled. Feedback email: [System Administrator]