nandyalu / trailarr

Trailarr is a Docker application to download and manage trailers for your Radarr and Sonarr libraries.
GNU General Public License v3.0
110 stars 7 forks source link

[Bug] Case-sensitive search #46

Closed DenisSolonevich closed 1 month ago

DenisSolonevich commented 1 month ago

It looks like the search is case-sensitive. Could you check it please for sure?

nandyalu commented 1 month ago

search in youtube? or search in Trailarr app search bar?

DenisSolonevich commented 1 month ago

Search in Trailarr. E.g. Harry Potter - OK harry potter - Nothing Found

nandyalu commented 1 month ago

It's working for me with lower case too...

Screenshot_20240928_154828_Samsung Internet.jpg

Can you post a screenshot if possible?

DenisSolonevich commented 1 month ago

You're right. I made more tests. It is case-sensitive for non-english (russian) language only. Could you please check it on the code-level?

eng ru_fail ru_success
nandyalu commented 1 month ago

@DenisSolonevich I have looked into this and it seems like a problem with sqlite database itself.

Important Note: SQLite only understands upper/lower case for ASCII characters by default. The LIKE operator is case sensitive by default for unicode characters that are beyond the ASCII range. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE. The ICU extension to SQLite includes an enhanced version of the LIKE operator that does case folding across all unicode characters.

Source: https://www.sqlite.org/lang_expr.html#the_like_glob_regexp_and_match_operators

There are some workarounds that can be implemented but it will come with performance degradation (takes more time to perform the search). Since the risks outweighs the benefits, we will not implement them at this time.