fix
This commit is contained in:
parent
2318a752b9
commit
f75902a97e
|
|
@ -62,7 +62,7 @@ async def t_callback_owned_content(query: types.CallbackQuery, memory=None, user
|
||||||
async def t_callback_node_content(query: types.CallbackQuery, memory=None, user=None, db_session=None, chat_wrap=None, **extra):
|
async def t_callback_node_content(query: types.CallbackQuery, memory=None, user=None, db_session=None, chat_wrap=None, **extra):
|
||||||
content_oid = int(query.data.split('_')[1])
|
content_oid = int(query.data.split('_')[1])
|
||||||
return await chat_wrap.send_content(
|
return await chat_wrap.send_content(
|
||||||
db_session.query(StoredContent).filter_by(
|
db_session, db_session.query(StoredContent).filter_by(
|
||||||
id=content_oid
|
id=content_oid
|
||||||
).first(),
|
).first(),
|
||||||
message_id=query.message.message_id
|
message_id=query.message.message_id
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ from app.core._keyboards import get_inline_keyboard
|
||||||
|
|
||||||
|
|
||||||
class PlayerTemplates:
|
class PlayerTemplates:
|
||||||
async def send_content(self, content: StoredContent, extra_buttons=None, message_id=None):
|
async def send_content(self, db_session, content: StoredContent, extra_buttons=None, message_id=None):
|
||||||
local_content = None
|
local_content = None
|
||||||
content_type, content_encoding = 'application', 'x-binary'
|
content_type, content_encoding = 'application', 'x-binary'
|
||||||
cd_log = ""
|
cd_log = ""
|
||||||
|
|
@ -19,7 +19,9 @@ class PlayerTemplates:
|
||||||
if not content.encrypted:
|
if not content.encrypted:
|
||||||
local_content = content
|
local_content = content
|
||||||
else:
|
else:
|
||||||
local_content = content.decrypted_content
|
local_content = db_session.query(StoredContent).filter_by(
|
||||||
|
id=content.decrypted_content_id
|
||||||
|
).first()
|
||||||
# TODO: add check decrypted_content by .format_json()['content_cid']
|
# TODO: add check decrypted_content by .format_json()['content_cid']
|
||||||
if local_content:
|
if local_content:
|
||||||
cd_log += f"Decrypted: {local_content.hash}. "
|
cd_log += f"Decrypted: {local_content.hash}. "
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue