-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browse zip archives & other things #5885
Conversation
c5aa87c
to
2f6c35e
Compare
- Add files to zip by drag & drop - Delete from zip - Open FTP files with double click - Search and navigation bar suggestions in FTP folders - Copy folders to/from FTP - Preview files in zip and ftp folders - Simplified FilesystemOperations
Enable pin to favotites in FTP Enable create directory in FTP
@gave92 do you mind if I implement making files a handler for zip files to the pr (so that it can be set as the default app for archives)? |
That's a great idea, please do 👍 |
Love it, just a couple of minor things I noticed:
|
Thank you!
True, the default action should be copy. There's also another issue for which dragging a file into a zip archive defaults to move (which fails), default should be copy here as well.
True, it's the same for FTP, I don't think I'm adding either here |
Wow! Excellent job @gave92! |
I implemented making copy the default operation when dragging a file from a zip over a tab by using the same function for dropping into the layout blank space (also reduces code duplication), is that good with you? also, aside from the merge conflicts, lgtm |
Thanks! Edit: should be ready. |
Amazing |
using var ftpClient = new FtpClient(); | ||
ftpClient.Host = FtpHelpers.GetFtpHost(Path); | ||
ftpClient.Port = FtpHelpers.GetFtpPort(Path); | ||
ftpClient.Credentials = FtpManager.Credentials.Get(ftpClient.Host, FtpManager.Anonymous); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should also be distinguished by port.
item.ItemFile = await StorageFile.GetFileFromPathAsync(item.ItemPath); | ||
var text = await FileIO.ReadTextAsync(item.ItemFile); | ||
item.ItemFile = await StorageFileExtensions.DangerousGetFileFromPathAsync(item.ItemPath); | ||
var text = await ReadFileAsText(item.ItemFile); // await FileIO.ReadTextAsync(item.ItemFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What advantage does this have over FileIO.ReadTextAsync
? It seems to break TryLoadAsText as it doesn't throw when a file is not a text file and the resulting string always contains "\0\0\0\0".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also while at it, StorageFileExtensions.DangerousGetFileFromPathAsync
could be replaced with safer StorageItemHelpers.ToStorageItem<StorageFile>(item.Path);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@winston-de FileIO.ReadTextAsync
did not work for some reason on FTP but if it causes issues with normal previews and can't be easily fixed we can live without previews on FTP paths.
@d2dyno1 good point. (Note: it's StorageItemHelpers.ToStorageItem<BaseStorageFile>(...)
now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah well just seen why ReadFileAsText
always contains "\0\0\0\0", not sure if that's enough to fix all issues but going to fix it => fixed here f77064c
Resolved / Related Issues
Items resolved / related issues by this PR.
Details of Changes
Add details of changes here.
Replaced most of references to StorageFile and StorageFolder with new base classes that implements IStorageItem (BaseStorageFile[Folder]). The standard StorageFile[Folder], the FtpStorageFile[Folder] and the new ZipStorageFile[Folder] all derive from these base classes. This enables the following features "for free".
Features enabled by this PR
Comments, testing and contributions are welcome xD
Validation
How did you test these changes?