From b15d9f4303cddfacceceee5b0403954246b75a12 Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Tue, 19 Mar 2024 14:23:36 -0600 Subject: [PATCH] Update subgen.py --- subgen/subgen.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/subgen/subgen.py b/subgen/subgen.py index 182a41b..0366f7a 100644 --- a/subgen/subgen.py +++ b/subgen/subgen.py @@ -25,11 +25,8 @@ import whisper import re def convert_to_bool(in_bool): - if isinstance(in_bool, bool): - return in_bool - else: - value = str(in_bool).lower() - return value not in ('false', 'off', '0', 0) + # Convert the input to string and lower case, then check against true values + return str(in_bool).lower() in ('true', 'on', '1') # Replace your getenv calls with appropriate default values here plextoken = os.getenv('PLEXTOKEN', 'token here')