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):
|
||||
content_oid = int(query.data.split('_')[1])
|
||||
return await chat_wrap.send_content(
|
||||
db_session.query(StoredContent).filter_by(
|
||||
db_session, db_session.query(StoredContent).filter_by(
|
||||
id=content_oid
|
||||
).first(),
|
||||
message_id=query.message.message_id
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from app.core._keyboards import get_inline_keyboard
|
|||
|
||||
|
||||
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
|
||||
content_type, content_encoding = 'application', 'x-binary'
|
||||
cd_log = ""
|
||||
|
|
@ -19,7 +19,9 @@ class PlayerTemplates:
|
|||
if not content.encrypted:
|
||||
local_content = content
|
||||
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']
|
||||
if local_content:
|
||||
cd_log += f"Decrypted: {local_content.hash}. "
|
||||
|
|
|
|||
Loading…
Reference in New Issue