From f68bb4719a4da7115953cc2ab10f20baee329741 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Fri, 10 Mar 2023 20:49:48 -0800 Subject: bot: update datetime --- bot/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/bot.py b/bot/bot.py index c436f21..37fefac 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -149,7 +149,7 @@ async def process(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: exif = im.getexif() camera_model = "" - shot_datetime = "" + shot_datetime = None if exif: for key, val in exif.items(): if key in ExifTags.TAGS: @@ -175,7 +175,7 @@ async def process(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: caption=caption, alt="", model=camera_model, - createdAt=shot_datetime if len(shot_datetime) > 0 else datetime.now(), + createdAt=shot_datetime if shot_datetime else datetime.now(), uploadedAt=datetime.now()) output.seek(0) -- cgit v1.2.3