diff options
author | clarkzjw <[email protected]> | 2023-03-10 20:49:48 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-03-10 20:49:48 -0800 |
commit | f68bb4719a4da7115953cc2ab10f20baee329741 (patch) | |
tree | f273dcbfc86f22ff17cafaa292e247de6d67c646 /bot/bot.py | |
parent | 678496cc0757951478d16f8bd18c244dc581de40 (diff) | |
download | photo-f68bb4719a4da7115953cc2ab10f20baee329741.tar.gz |
bot: update datetime
Diffstat (limited to 'bot/bot.py')
-rw-r--r-- | bot/bot.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -149,7 +149,7 @@ async def process(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: | |||
149 | exif = im.getexif() | 149 | exif = im.getexif() |
150 | 150 | ||
151 | camera_model = "" | 151 | camera_model = "" |
152 | shot_datetime = "" | 152 | shot_datetime = None |
153 | if exif: | 153 | if exif: |
154 | for key, val in exif.items(): | 154 | for key, val in exif.items(): |
155 | if key in ExifTags.TAGS: | 155 | if key in ExifTags.TAGS: |
@@ -175,7 +175,7 @@ async def process(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: | |||
175 | caption=caption, | 175 | caption=caption, |
176 | alt="", | 176 | alt="", |
177 | model=camera_model, | 177 | model=camera_model, |
178 | createdAt=shot_datetime if len(shot_datetime) > 0 else datetime.now(), | 178 | createdAt=shot_datetime if shot_datetime else datetime.now(), |
179 | uploadedAt=datetime.now()) | 179 | uploadedAt=datetime.now()) |
180 | 180 | ||
181 | output.seek(0) | 181 | output.seek(0) |