From 6cacdd59fe81b2e90b63bb42bf5c7e4ee62f50af Mon Sep 17 00:00:00 2001 From: YozoraXCII <96386153+YozoraXCII@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:28:57 +0000 Subject: [PATCH] Add Start Time, End Time and Run Time to Summary of run. (#2361) --- CHANGELOG | 1 + kometa.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b307f6bc..57e79448 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -37,4 +37,5 @@ Modifies default value presentation for default metadata files. Fixes an issue causing IMDB collection to fail due to duplicate keys Removed Blog from the Navigation due to lack of time for updating/maintaining it Fixes #2354 by updating version of tmdbapi dependency +Added Start Time, End Time and Run Time to Summary of run. Date of Start/End Time now only displays if the Start and End are on different dates. diff --git a/kometa.py b/kometa.py index 2c949663..491caeae 100644 --- a/kometa.py +++ b/kometa.py @@ -428,7 +428,14 @@ def start(attrs): logger.stacktrace() logger.error(f"Report Error: {e}") - logger.separator(f"Finished {start_type}Run\n{version_line}\nFinished: {end_time.strftime('%H:%M:%S %Y-%m-%d')} Run Time: {run_time}") + if start_time.date() == end_time.date(): + start_str = start_time.strftime('%H:%M:%S') + end_str = end_time.strftime('%H:%M:%S') + else: + start_str = start_time.strftime('%H:%M:%S %Y-%m-%d') + end_str = end_time.strftime('%H:%M:%S %Y-%m-%d') + + logger.separator(f"Finished {start_type}Run\n{version_line}\nStart Time: {start_str} End Time: {end_str} Run Time: {run_time}") logger.remove_main_handler() except Exception as e: logger.stacktrace()