diff --git a/app/client_bot/routers/content.py b/app/client_bot/routers/content.py index 8eac540..f9ac81f 100644 --- a/app/client_bot/routers/content.py +++ b/app/client_bot/routers/content.py @@ -102,10 +102,12 @@ async def t_inline_query_node_content(query: types.InlineQuery, memory=None, use source_args_ext = query.query if source_args.startswith('Q'): - license_onchain_address = query.query[1:] - args = db_session.query(UserContent).filter_by( + license_onchain_address = source_args[1:] + licensed_content = db_session.query(UserContent).filter_by( onchain_address=license_onchain_address, - ).first().content.cid.serialize_v2() + ).first().content + make_log("InlineSearch", f"Query '{query.query}' is a license query for content ID {licensed_content.id}.", level='info') + args = content.cid.serialize_v2() else: args = source_args[1:] diff --git a/app/core/background/convert_service.py b/app/core/background/convert_service.py index c74f42d..b43ab0a 100644 --- a/app/core/background/convert_service.py +++ b/app/core/background/convert_service.py @@ -32,8 +32,13 @@ async def convert_loop(memory): if not unprocessed_encrypted_content: make_log("ConvertProcess", "No content to convert", level="debug") return + + # Static preview interval in seconds + preview_interval = [0, 30] + if unprocessed_encrypted_content.onchain_index in [2]: + preview_interval = [0, 60] - make_log("ConvertProcess", f"Processing content {unprocessed_encrypted_content.id}", level="debug") + make_log("ConvertProcess", f"Processing content {unprocessed_encrypted_content.id} with preview interval {preview_interval}", level="info") decrypted_content = session.query(StoredContent).filter( StoredContent.id == unprocessed_encrypted_content.decrypted_content_id ).first() @@ -41,11 +46,6 @@ async def convert_loop(memory): make_log("ConvertProcess", "Decrypted content not found", level="error") return - # Static preview interval in seconds - preview_interval = [0, 30] - if unprocessed_encrypted_content.onchain_index in [2]: - preview_interval = [0, 60] - # List of conversion options to process REQUIRED_CONVERT_OPTIONS = ['high', 'low', 'low_preview']