From f174a3b898adf03970e03bdb525de0c183909f6e Mon Sep 17 00:00:00 2001 From: amtoaer Date: Sat, 2 Dec 2023 00:46:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=8C=E5=87=AD=E6=8D=AE=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E4=BB=8E=E7=AC=AC=E4=BA=8C=E5=A4=A9=E5=BC=80=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands.py | 2 +- processor.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/commands.py b/commands.py index 7128672..ea9a1e8 100644 --- a/commands.py +++ b/commands.py @@ -54,7 +54,7 @@ async def upper_thumb(): other_tasks.extend( [ upper.save_metadata(), - download_content(upper.thumb_url, upper.thumb_path), + download_content(upper.thumb, upper.thumb_path), ] ) await asyncio.gather(*makedir_tasks) diff --git a/processor.py b/processor.py index 18b1ce3..efb3d7c 100644 --- a/processor.py +++ b/processor.py @@ -81,10 +81,12 @@ async def manage_model(medias: list[dict], fav_list: FavoriteList) -> None: async def process() -> None: global anchor - if datetime.date.today() >= anchor and await credential.check_refresh(): + if ( + today := datetime.date.today() + ) > anchor and await credential.check_refresh(): try: await credential.refresh() - anchor = datetime.date.today() + datetime.timedelta(days=1) + anchor = today logger.info("Credential refreshed.") except Exception: logger.exception("Failed to refresh credential.")