Closed vanushah closed 9 months ago
Thank you for the detailed description and steps. Unfortunately, it makes the process somewhat convoluted and adds several dependencies to all users for a problem that only affects a small subset. And since Google Drive is now using the File Provider API, it may even be possible that you can find files without the need for the workflow.
As such I won’t integrate the fix officially, but this post could be quite useful to direct other users who have the same problem. Again, thank you for taking the time to write it. I have a few ideas for the (non-near) future of the workflow, that if viable may end up solving the issue without needing the extra steps.
Have a great weekend.
Feature details
Hello.
I've found out that the search for non-Latin characters is case-sensitive. So when I search for
сбер
, it cannot find occurrences ofСбер
, for example.I found out why this is happening. By default, the
LIKE
operator in this query is case-sensitive for Unicode characters. To make it case-insensitive, you must compile and load the ICU extension. Here is the link to this extension: linkI've managed to compile and change the
gd
script to solve the issue. However, I'm unsure how to integrate my changes into themain
branch.So, at least, I wanted to share the steps that I took to achieve this:
Installed
icu4c
,ruby
,gcc
andpkg-config
packages withbrew
:Downloaded and untared the source code of
sqlite3
via this link: https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=releaseCompiled the extension:
Note if your command output complains like that:
Then you need to set
PKG_CONFIG_PATH
environment variable before trying to compile the extension.You need to install
sqlite3
gem for Homebrew ruby:Patched the
gd
script so it would use Homebrewruby
(I have an Apple Silicon Mac, so my Homebrew is under the/opt
folder) and would load the extension:require 'json' require 'sqlite3'
[...]
Filter paths
db = SQLite3::Database.new(Cache_file) db.enable_load_extension(true)
NB: Your path might be different
db.load_extension("/Users/ivan/Downloads/sqlite/ext/icu/libicu.dylib") Results = db.execute("SELECT fullpath FROM main WHERE #{Dir_only} #{Array.new(Query.length, 'basename LIKE ?').join(' AND ')} ORDER BY accesstime DESC LIMIT ?;", Query, Limit).flatten