From a8e7299dbe655d0e9d6d255b5b377c21e8937244 Mon Sep 17 00:00:00 2001 From: tcely Date: Mon, 3 Feb 2025 11:44:02 -0500 Subject: [PATCH] Log units and number within the try block --- tubesync/sync/tasks.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tubesync/sync/tasks.py b/tubesync/sync/tasks.py index 0433fe1b..276fb348 100644 --- a/tubesync/sync/tasks.py +++ b/tubesync/sync/tasks.py @@ -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