Skip to content

Commit

Permalink
use removeprefix
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Oct 8, 2024
1 parent eedd1c1 commit 70229ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions subliminal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def sanitize_release_group(string: str) -> str:
@none_passthrough
def sanitize_id(id_: str | int) -> int:
"""Sanitize the IMDB (or other) id and transform it to a string (without leading 'tt' or zeroes)."""
# TODO: use str.removeprefix('tt')
id_ = str(id_).lower().lstrip('t')
id_ = str(id_).lower().removeprefix('tt')
return int(id_)


Expand Down

0 comments on commit 70229ea

Please sign in to comment.