Skip to content

Commit

Permalink
Main: Fix tryint() throwing errors (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
C0rn3j authored Nov 23, 2024
1 parent ca89e7d commit d3fe828
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/tauon/t_modules/t_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17423,13 +17423,10 @@ def append_playlist(index):
reload()


def tryint(s):
try:
return int(s)
except Exception:
logging.exception("Failed to parse as int")
return s

def tryint(s: str) -> int | str:
if isinstance(s, (int, float)):
return int(s)
return s

def index_key(index):
tr = pctl.master_library[index]
Expand Down

0 comments on commit d3fe828

Please sign in to comment.