Log units and number within the try block

This commit is contained in:
tcely 2025-02-03 11:44:02 -05:00 committed by GitHub
parent bf0dcc631a
commit a8e7299dbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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