Skip to content

Commit

Permalink
Lowercase input of istartswith/iendswith (#1359)
Browse files Browse the repository at this point in the history
To be symmetric with other case insensitive methods
that lowercase both operands in comparison
  • Loading branch information
glensc committed Feb 17, 2024
1 parent 7c99d4a commit 4b67b4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plexapi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
'lt': lambda v, q: v < q,
'lte': lambda v, q: v <= q,
'startswith': lambda v, q: v.startswith(q),
'istartswith': lambda v, q: v.lower().startswith(q),
'istartswith': lambda v, q: v.lower().startswith(q.lower()),
'endswith': lambda v, q: v.endswith(q),
'iendswith': lambda v, q: v.lower().endswith(q),
'iendswith': lambda v, q: v.lower().endswith(q.lower()),
'exists': lambda v, q: v is not None if q else v is None,
'regex': lambda v, q: bool(re.search(q, v)),
'iregex': lambda v, q: bool(re.search(q, v, flags=re.IGNORECASE)),
Expand Down

0 comments on commit 4b67b4d

Please sign in to comment.