From 7c947f51b6ae8f68e98e30073b3b7a7cccf57310 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 1 Mar 2025 04:05:41 +0300 Subject: [PATCH] fixes --- app/core/background/indexer_service.py | 10 +++++----- app/core/models/_telegram/templates/player.py | 5 ++++- locale/en/LC_MESSAGES/sanic_telegram_bot.mo | Bin 5660 -> 5806 bytes locale/en/LC_MESSAGES/sanic_telegram_bot.po | 13 +++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/core/background/indexer_service.py b/app/core/background/indexer_service.py index 7dd0178..f6dfb0a 100644 --- a/app/core/background/indexer_service.py +++ b/app/core/background/indexer_service.py @@ -6,7 +6,7 @@ from base58 import b58encode from sqlalchemy import and_, desc from tonsdk.boc import Cell from tonsdk.utils import Address - +from app.core._config import CLIENT_TELEGRAM_BOT_USERNAME from app.core._blockchain.ton.platform import platform from app.core._blockchain.ton.toncenter import toncenter from app.core._utils.send_status import send_status @@ -221,9 +221,9 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]: message_type='notification', reply_markup=get_inline_keyboard([ [{ - 'text': user.translated('home_button'), - 'callback_data': 'home' - }] + 'text': user.translated('viewTrackAsClient_button'), + 'url': f"https://t.me/{CLIENT_TELEGRAM_BOT_USERNAME}?start=C{encrypted_stored_content.cid.serialize_v2()}" + }], ]) ) @@ -231,7 +231,7 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]: and_( KnownTelegramMessage.chat_id == user.telegram_id, KnownTelegramMessage.type == 'hint', - KnownTelegramMessage.meta.contains({'encrypted_content_hash': encrypted_stored_content.hash}), + KnownTelegramMessage.meta['encrypted_content_hash'].astext == encrypted_stored_content.hash, KnownTelegramMessage.deleted == False ) ).all(): diff --git a/app/core/models/_telegram/templates/player.py b/app/core/models/_telegram/templates/player.py index d616004..ab66b59 100644 --- a/app/core/models/_telegram/templates/player.py +++ b/app/core/models/_telegram/templates/player.py @@ -41,7 +41,7 @@ class PlayerTemplates: local_content_meta = local_content.json_format() make_log("TG-Player", f"Content meta: {content_meta}. Local content meta: {local_content_meta}. ") try: - content_type, content_encoding = local_content_meta["content_type"].split('/') + content_type, content_encoding = "audio", "aac" except: content_type, content_encoding = 'application', 'x-binary' @@ -77,6 +77,9 @@ class PlayerTemplates: preview_content = db_session.query(StoredContent).filter( StoredContent.hash == converted_content['low_preview'] ).first() + if preview_content.filename.split('.')[-1] in ['mov', 'mp4']: + content_type = 'video' + local_content_preview_url = preview_content.web_url if content_type == 'audio': audio_title = content_metadata_json.get('name', "").split(' - ') diff --git a/locale/en/LC_MESSAGES/sanic_telegram_bot.mo b/locale/en/LC_MESSAGES/sanic_telegram_bot.mo index 81897f5d7ae48d07250112c1d418c8a8e615bef6..243cbdb51df67257298bc21af1e9ade9857ae387 100644 GIT binary patch delta 554 zcmZ`#J5Iw;5PXT!A|V1P(JKJ)35Y63prAtB0q&40_A}r}AR!UaAcVvP&~t*pv5C3D z>?ybcC9`%SrJ?b7-_Fj?>~r_+(6^c=zYSxK+s5n~WA-+T*&&`2w}^e>1@VQrO>A{) z+$Z)}pAnTGcP6LJpVfm0cp1W5aT35|hEINTxj`oPRw4=Ujg*WT%2Be`9*~O6vh;F| z67S?W3CYFSqLi5A0I9xLB+GHK#9>@@KG;b)oguYIP_UWn5T?2TUq=>CYJh%N7IKFi z<&wF}C3i?9QaN$|ZSmdOX-sj_YM<2vWmH^a(0WNJO`kA<<3>M{mCXT%8DcEAwS2*A z#2S~@xtMvloR%44kw`*Y`E%?q7L=G$2Q#^%ctE<><7#5=wY22;!U0}7W%^eh%=14( gk8ZkFV!cFVV{Woo+*fVG5%zfW_-E?MW4vG<_(u+!MD5aj4lv*Rd$Q5!z zn&ezesa3N4%NKHo{{b29f5*CqGn0k*8v+c`lPVl^Fp?Jf@Ddsi(tKQ=k5`6pF@me5 zMmfNT#wX#6%{_h-Q9L1#n%Gjun4*RsCP-alOrb@WOR**`jgAg&(g>}L?N4_Z943zB zo^<6_!=vU)UF=j8l{PvidR*{Wu?FAfGNLc`v|oo# zj#;JwhqFvUm&#^wFIlpztLt6Euu>PMk;|VPo2T39{YxvE&E@scdEv$^XN*ENiZ(ls WnRmyU&9HHJBH#%JgYJ5)5%~eCR^CVe diff --git a/locale/en/LC_MESSAGES/sanic_telegram_bot.po b/locale/en/LC_MESSAGES/sanic_telegram_bot.po index 9b2f1ef..3db50c2 100644 --- a/locale/en/LC_MESSAGES/sanic_telegram_bot.po +++ b/locale/en/LC_MESSAGES/sanic_telegram_bot.po @@ -181,16 +181,13 @@ msgstr "" "💶 {username} только что приобрёл лицензию на {content_title}. 👏\n" "Ваш контент набирает популярность! Продолжайте творить и вдохновлять 🚀." -#: app/api/routes/_blockchain.py:150 app/bot/routers/tonconnect.py:90 -#: app/core/background/indexer_service.py:141 app/bot/routers/tonconnect.py:92 -#: app/core/background/indexer_service.py:156 app/api/routes/_blockchain.py:149 -#: app/client_bot/routers/tonconnect.py:94 msgid "p_uploadContentTxRequested" msgstr "" -"Поздравляем! Вы успешно загрузили свой контент!\n" -"Доступ к нему появится в течение нескольких минут.\n" -"Увeдомление c загруженным контентом придет к вам в чат MY Player\n" -"Успешных продаж!" +"Ваша транзакция успешно отправлена и находится в очереди на подтверждение блокчейном. " +"Как только транзакция будет подтверждена, начнется детальная обработка вашего контента, " +"и вы получите уведомление с актуальной информацией о статусе. " +"Спасибо, что выбрали нашу платформу!" + msgid "shareLink_button" msgstr "🔗 Поделиться ссылкой"