From 7ff81c84b3a3711ac0800708b333f331a4d91471 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Jul 2016 09:27:59 +0530 Subject: [PATCH] Tag mapper: Fix upper case characters not working in "contains" rules --- src/calibre/ebooks/metadata/tag_mapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/tag_mapper.py b/src/calibre/ebooks/metadata/tag_mapper.py index 2e307355fc..d34bf350fd 100644 --- a/src/calibre/ebooks/metadata/tag_mapper.py +++ b/src/calibre/ebooks/metadata/tag_mapper.py @@ -32,7 +32,7 @@ def matcher(rule): return lambda x: pat.match(x) is None if mt == 'has': - s = rule['query'] + s = icu_lower(rule['query']) return lambda x: s in x return lambda x: False @@ -153,6 +153,7 @@ def test(): run([rule('replace', 't1', 't2'), rule('replace', 't2', 't1')], 't1,t2', 't1,t2') run(rule('replace', 'a', 'A'), 'a,b', 'A,b') run(rule('replace', 'a,b', 'A,B'), 'a,b', 'A,B') + run(rule('replace', 'L', 'T', 'has'), 'L', 'T') run(rule('split', '/', '/', 'has'), 'a/b/c,d', 'a,b,c,d') run(rule('split', '/', '/', 'has'), '/,d', 'd') run(rule('split', '/', '/', 'has'), '/a/', 'a')