diff options
| author | Joris Guyonvarch | 2025-12-30 17:34:13 +0100 |
|---|---|---|
| committer | Joris Guyonvarch | 2025-12-30 17:34:13 +0100 |
| commit | 65cae8a887504f49735aa9035ae53fcffd10fbc9 (patch) | |
| tree | 49bd8ddca5be035b51a08a9516d1ee78d18941c4 /src/str_format.py | |
| parent | 9566791adef22f0f1102bf73f0ba02ae9842b7cf (diff) | |
Add textual search
Search in titles, subtitles, authors and years.
Diffstat (limited to 'src/str_format.py')
| -rw-r--r-- | src/str_format.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/str_format.py b/src/str_format.py index 5d8c412..aaa0440 100644 --- a/src/str_format.py +++ b/src/str_format.py @@ -6,6 +6,9 @@ def safe_path(name): simplified = ''.join([alnum_or_space(c) for c in unaccent(name.lower())]) return '-'.join(simplified.split()) +def for_search(s): + return unaccent(s.lower()) + def unaccent(s): return ''.join(c for c in unicodedata.normalize('NFD', s) if unicodedata.category(c) != 'Mn') |
