Skip to content

Commit 4b67b4d

Browse files
authored
Lowercase input of istartswith/iendswith (#1359)
To be symmetric with other case insensitive methods that lowercase both operands in comparison
1 parent 7c99d4a commit 4b67b4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: plexapi/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
'lt': lambda v, q: v < q,
2323
'lte': lambda v, q: v <= q,
2424
'startswith': lambda v, q: v.startswith(q),
25-
'istartswith': lambda v, q: v.lower().startswith(q),
25+
'istartswith': lambda v, q: v.lower().startswith(q.lower()),
2626
'endswith': lambda v, q: v.endswith(q),
27-
'iendswith': lambda v, q: v.lower().endswith(q),
27+
'iendswith': lambda v, q: v.lower().endswith(q.lower()),
2828
'exists': lambda v, q: v is not None if q else v is None,
2929
'regex': lambda v, q: bool(re.search(q, v)),
3030
'iregex': lambda v, q: bool(re.search(q, v, flags=re.IGNORECASE)),

0 commit comments

Comments
 (0)