-
Notifications
You must be signed in to change notification settings - Fork 29
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
Bunch of fixes and improvements related to SAF/FSAF, image loading etc #712
Conversation
- Update FSAF to v1.0-alpha36. (Snapshots have been reworked, a bug related to snapshots has been fixed (now we shouldn't see bugs where files or directories cannot be created for some unknown reason), some changes to clone() methods, flattenSegments() implementation, get rid of cloneUnsafe() in Kuroba and some other changes). - Move handleLocalThreadFile() method call to a background thread to avoid micro freezes when swiping images in a local thread or in a downloading thread. - Do not download inlined files for local threads (inlined files now have isInlined flag set to true, it's false by default and only being set in one place - where we parse them). - Use new Snapshots in ThreadSaveManager. - Try to create default base directories, if they weren't set by the user and if they don't exist, when trying to download an image or an album. - A little bit of optimization for getSaveLocation(). First of all it now won't be called twice. Second it will return a flattened AbstractFile (no intermediate segments).
- Fix MissingBackpressureException when downloading thread albums. - Fix app freezing (and depending on how many images in a thread even ANRing) when downloading thread albums. Because we need to check a lot of stuff before downloading an image (like create all the necessary directories, deduplicate the file name, etc). - Relax directory and file name filtering rules. Previous regex was really strict, so if an image contained any non-english letters, they all would be replaced with "_" which is a big problem for non-english image boards (almost every image name would contain lots of "_" symbols and it could even cause collisions). Now it only filters out special symbols and periods (only in directory names). Everything else is allowed. - Do not download inlined files when downloading thread albums. Some of the hosts are bad and cause SSL exceptions and other stuff. Also, inlined files may be really big and we can't check how big they are unless we download them first.
…ctory to a new one when both of them were using the same file provider (update FSAF to v1.0-alpha38)
This looks good and all, but what issues does this close? There's quite a few of them and it would be good to close them out when this gets merged. |
Oh yeah, I forgot to link them. |
Alright, I linked some issues that are related to this PR. |
Wait, do not merge this one yet. I'm gonna change how we copy the apk that we download in UpdateManager to use SAF so we don't have those strange errors anymore. |
Alright, it's ready. |
Yeah I dunno about that last commit. Seems like it's gonna get super annoying for people on dev. |
Well, probably. But at least it shouldn't crash anymore with this #703 message |
It seems like this (https://stackoverflow.com/questions/42516126/fileprovider-illegalargumentexception-failed-to-find-configured-root) is the solution but since I can't reproduce it and I have no idea what's going on there I can't use it |
And it seems like we are already doing the same thing. We have both cache-path and external-cache-path so I have no idea what it doesn't like. |
I can revert the last commit if you have a better solution that does not involve SAF. |
I think I'd be fine with a setting in Behvaiour -> Other that disabled the check, with the setting being "show the dialog" by default. |
Alright. |
…exiting immediately when called right after exiting the SAF file chooser
Closes #694, #687, #638, #579, #703
Maybe closes #696, #690, #560
some changes to clone() methods, flattenSegments() implementation, get rid of cloneUnsafe() in Kuroba and some other changes).
non-english image boards (almost every image name would contain lots of _ symbols and it could even cause collisions). Now it only filters out special symbols and periods (only in directory names). Everything else is allowed.