From e18211f35e2a6fe3926293e4d6a96d6d955d0970 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 20 Jan 2021 20:53:00 -0500 Subject: [PATCH] Added Time Display --- modules/config.py | 9 --------- plex_meta_manager.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/config.py b/modules/config.py index 59a95c39..5ffda651 100644 --- a/modules/config.py +++ b/modules/config.py @@ -404,15 +404,6 @@ class Config: util.seperator("Mapping {} Library".format(library.name)) logger.info("") movie_map, show_map = self.map_guids(library) - - unmanaged_collections = [col.title for col in library.get_all_collections() if col.title not in collections] - if len(unmanaged_collections) > 0: - for col in unmanaged_collections: - logger.info(col) - logger.info("{} Unmanaged Collections".format(len(unmanaged_collections))) - else: - logger.info("No Unmanaged Collections") - for c in collections: try: logger.info("") diff --git a/plex_meta_manager.py b/plex_meta_manager.py index c1e575dc..807e18ab 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -78,9 +78,20 @@ try: if args.run: start(args.config) else: + length = 0 schedule.every().day.at(args.time).do(start, args.config) while True: schedule.run_pending() + current = datetime.datetime.now().strftime("%H:%M") + seconds = (datetime.datetime.strptime(args.time, "%H:%M") - datetime.datetime.strptime(current, "%H:%M")).total_seconds() + hours = int(seconds // 3600) + if hours < 0: + hours += 24 + minutes = int((seconds % 3600) // 60) + time_str = "{} Hour{} and ".format(hours, "s" if hours > 1 else "") if hours > 0 else "" + time_str += "{} Minute{}".format(minutes, "s" if minutes > 1 else "") + + length = util.print_return(length, "Current Time: {} | {} until the daily run at {}".format(current, time_str, args.time)) time.sleep(1) except KeyboardInterrupt: util.seperator("Exiting Plex Meta Manager")