Log units and number within the try block

This commit is contained in:
tcely authored and GitHub committed 2025-02-03 11:44:02 -05:00
1 parent bf0dcc631a
commit a8e7299dbe
1 file changed
+6 -5
+6 -5
View File
@@ -326,14 +326,15 @@ def download_media_metadata(media_id):
unit = lambda p: str(p[-1]).lower()
number = lambda p: int(str(p[-2]), base=10)
log.debug(parts)
log.debug(unit(parts))
try:
if 'days' == unit(parts):
published_datetime = now + timedelta(days=number(parts))
if 'hours' == unit(parts):
published_datetime = now + timedelta(hours=number(parts))
if 'minutes' == unit(parts):
published_datetime = now + timedelta(minutes=number(parts))
elif 'hours' == unit(parts):
published_datetime = now + timedelta(hours=number(parts))
elif 'days' == unit(parts):
published_datetime = now + timedelta(days=number(parts))
log.debug(unit(parts))
log.debug(number(parts))
except Exception as ee:
log.exception(ee)
pass