From 124c7533d7fc007cfcefb7c76f85897c6cbe9544 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Fri, 24 May 2024 23:34:00 +0800 Subject: [PATCH] :bug: Fix hoyolab missing diary date --- plugins/genshin/ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/genshin/ledger.py b/plugins/genshin/ledger.py index 14abe736..48e8f810 100644 --- a/plugins/genshin/ledger.py +++ b/plugins/genshin/ledger.py @@ -150,7 +150,7 @@ class LedgerPlugin(Plugin): async def save_ledger_data( history_data_ledger: "HistoryDataLedgerServices", uid: int, ledger_data: "Diary" ) -> bool: - month = int(ledger_data.date.split("-")[1]) + month = int((ledger_data.date or datetime.now().strftime("%Y-%m-%d")).split("-")[1]) if month == ledger_data.month: return False model = history_data_ledger.create(uid, ledger_data)