diff --git a/app/api/routes/content.py b/app/api/routes/content.py index c76e9d4..df99c8c 100644 --- a/app/api/routes/content.py +++ b/app/api/routes/content.py @@ -75,7 +75,7 @@ async def s_api_v1_content_view(request, content_address: str): invoice_url = await Bot(token=CLIENT_TELEGRAM_API_KEY).create_invoice_link( 'Lifetime access to content', 'You will receive NFT with lifetime access to content', - f"access_{invoice_id}", "", "XTR", + invoice_id, "", "XTR", [ types.LabeledPrice(label='Lifetime access', amount=stars_cost), ], @@ -94,10 +94,11 @@ async def s_api_v1_content_view(request, content_address: str): except BaseException as e: make_log("Content", f"Can't create invoice link: {e}", level='warning') - opts['invoice'] = { - 'url': invoice_url, - 'amount': stars_cost, - } + if invoice_url: + opts['invoice'] = { + 'url': invoice_url, + 'amount': stars_cost, + } display_options = { 'content_url': content['decrypted_content'].web_url + ( diff --git a/app/core/background/convert_service.py b/app/core/background/convert_service.py index 8d544b8..3fd6d1f 100644 --- a/app/core/background/convert_service.py +++ b/app/core/background/convert_service.py @@ -119,7 +119,7 @@ async def convert_loop(): file_hash = hash_stdout.decode().split()[0] file_hash = b58encode(bytes.fromhex(file_hash)).decode() - if not db_session.query(StoredContent).filter( + if not session.query(StoredContent).filter( StoredContent.hash == file_hash ).first(): new_content = StoredContent(