From 3bbba3217ad2d0c9257cc73e6c8a3d46ff89898c Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Fri, 24 Nov 2023 20:50:22 -0500 Subject: [PATCH] More fixes for dragging milliseconds out of the time diff --- bin/breadmixer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/breadmixer.py b/bin/breadmixer.py index 3c11432..fc08647 100644 --- a/bin/breadmixer.py +++ b/bin/breadmixer.py @@ -74,10 +74,14 @@ for file in os.listdir(os.path.join(json_config["media_voice_folder"], args.call # which creates the obnoxious 0,0 double dereference operation user_lut[user_snowflake] = username[0][0] + + file_stamp_as_datetime = datetime.datetime.fromtimestamp(timestamp / 1000) + time_diff = file_stamp_as_datetime - call_start_time[0][0] + file_dict[file] = dict( user=user_lut[user_snowflake], - real_date=datetime.datetime.fromtimestamp(timestamp / 1000), - seconds_from_starttime=(datetime.datetime.fromtimestamp(timestamp / 1000) - call_start_time[0][0]).milliseconds + real_date=file_stamp_as_datetime, + milliseconds_from_starttime=int((time_diff.seconds * 1000) + (time_diff.microseconds / 1000)) ) pprint(file_dict)