From b4d786cb34f59afd20c20ee3b02982b582c50f17 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 22 Sep 2021 08:43:21 -0400 Subject: [PATCH] check for None Seconds --- plex_meta_manager.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plex_meta_manager.py b/plex_meta_manager.py index 67f573db..1a1e3457 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -583,11 +583,14 @@ try: if (seconds is None or new_seconds < seconds) and new_seconds > 0: seconds = new_seconds og_time_str = time_to_run - hours = int(seconds // 3600) - minutes = int((seconds % 3600) // 60) - time_str = f"{hours} Hour{'s' if hours > 1 else ''} and " if hours > 0 else "" - time_str += f"{minutes} Minute{'s' if minutes > 1 else ''}" - util.print_return(f"Current Time: {current} | {time_str} until the next run at {og_time_str} | Runs: {', '.join(times_to_run)}") + if seconds is not None: + hours = int(seconds // 3600) + minutes = int((seconds % 3600) // 60) + time_str = f"{hours} Hour{'s' if hours > 1 else ''} and " if hours > 0 else "" + time_str += f"{minutes} Minute{'s' if minutes > 1 else ''}" + util.print_return(f"Current Time: {current} | {time_str} until the next run at {og_time_str} | Runs: {', '.join(times_to_run)}") + else: + logger.error(f"Time Error: {valid_times}") time.sleep(60) except KeyboardInterrupt: util.separator("Exiting Plex Meta Manager")