-
-
Notifications
You must be signed in to change notification settings - Fork 196
Multiple fixes for path-related issues and other stuff... #1419
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
base: dev
Are you sure you want to change the base?
Conversation
Fix Difegue#1410 Fix Difegue#1418 Added get_archive_path for getting the archive path without going through create_path every time. Better handling of special characters when uploading files.
lib/LANraragi/Model/Upload.pm
Outdated
| # Add the file to the database ourselves so Shinobu doesn't do it | ||
| # This allows autoplugin to be ran ASAP. | ||
| my $name = add_archive_to_redis( $id, $output_file, $redis, $redis_search ); | ||
| my $name = add_archive_to_redis( $id, redis_encode( redis_decode( $output_file ) ), $redis, $redis_search ); |
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'm quite wary of this PR making changes to effectively store encoded filenames in Redis instead of raw bytes from the FS - Historically not using the exact filepaths the host filesystem caused a ton of issues on systems with weird locales.
| $tempdir | ||
| ); | ||
|
|
||
| my $mojo_temp = tmpnam(); # Create another temp file as a target for Mojo's move_to so that the original handle can be closed |
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.
At a glance I'm not sure which problem this solves so it probably at least needs more commenting 🤔
What does the original handle mentioned here belong to -- The mojo $file?
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 will add them but the tl;dr is that mojo holds an open handle to the file blocking it from being moved on Windows. Yes, the $file object holds it.
746ee52 to
69638f0
Compare
Win32::FileSystemHelper diff