This commit is contained in:
user committed 2025-02-28 13:46:27 +03:00
1 parent 3525f73b99
commit 1ee8112734
3 files changed
+8 -4

No files matched your search

+6 -2
View File
@@ -140,7 +140,11 @@ async def t_inline_query_node_content(query: types.InlineQuery, memory=None, use
if True or not decrypted_content.meta.get('telegram_file_cache_preview'):
try:
# Construct URL for trimmed preview using decrypted content
preview_url = f"{PROJECT_HOST}/api/v1/storage/{decrypted_content.cid.serialize_v2(include_accept_type=True)}?seconds_limit=30"
preview_content = db_session.query(StoredContent).filter_by(
hash=content.meta.get('converted_content', {}).get('low_preview')
).first()
preview_url = preview_content.web_url
if content_type_declared == 'video':
preview_message = await query.bot.send_video(
chat_id=CACHE_CHAT_ID, # Cache chat id defined in configuration
@@ -169,7 +173,7 @@ async def t_inline_query_node_content(query: types.InlineQuery, memory=None, use
make_log("OwnedContent", f"Error uploading preview {content_type_declared}: {e}", level='error')
content_share_link = {
'text': user.translated('p_shareLinkContext').format(title=audio_title),
'text': user.translated('p_shareLinkContext').format(title=' – '.join(audio_title)),
'url': f"https://t.me/{CLIENT_TELEGRAM_BOT_USERNAME}?start=C{content.cid.serialize_v2()}"
}
@@ -169,7 +169,7 @@ class PlayerTemplates:
or bool(self.db_session.query(UserContent).filter_by(owner_address=user_wallet_address, status='active', content_id=content.id).first())
or bool(self.db_session.query(UserContent).filter(
and_(
StarsInvoice.user_id == self.user,
StarsInvoice.user_id == self.user.id,
StarsInvoice.content_hash == content['encrypted_content'].hash,
StarsInvoice.paid == True
)