From 79593f1e75b9bc93b1b9af30383aabbd87b36664 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 1 Mar 2025 14:01:00 +0300 Subject: [PATCH] stars fixes --- app/api/routes/content.py | 4 ++-- app/core/background/license_service.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/routes/content.py b/app/api/routes/content.py index 8e4167a..a10ff17 100644 --- a/app/api/routes/content.py +++ b/app/api/routes/content.py @@ -86,13 +86,13 @@ async def s_api_v1_content_view(request, content_address: str): StarsInvoice.user_id == request.ctx.user.id, StarsInvoice.created > datetime.now() - timedelta(minutes=25), StarsInvoice.amount == stars_cost, - StarsInvoice.external_id == invoice_id + StarsInvoice.content_hash == content['encrypted_content'].hash, ) ).first() if exist_invoice: invoice_url = exist_invoice.invoice_url else: - invocie_url = None + invoice_url = None try: invoice_url = await Bot(token=CLIENT_TELEGRAM_API_KEY).create_invoice_link( 'Lifetime access to content', diff --git a/app/core/background/license_service.py b/app/core/background/license_service.py index 1389f56..691d345 100644 --- a/app/core/background/license_service.py +++ b/app/core/background/license_service.py @@ -31,7 +31,7 @@ async def license_index_loop(memory, platform_found: bool, seqno: int) -> [bool, async def check_telegram_stars_transactions(): # Проверка звездных telegram транзакций, обновление paid offset = {'desc': 'Статичное число заранее известного количества транзакций, которое даже не знает наш бот', 'value': 1}['value'] + \ - session.query(StarsInvoice).count() + 0 # session.query(StarsInvoice).count() limit = 100 while True: make_log("StarsProcessing", f"Star payments: offset={offset}, limit={limit}", level="DEBUG")