fixes
This commit is contained in:
1 parent
7c947f51b6
commit
181d980e48
3 files changed
+7
-2
No files matched your search
+2
-1
@@ -21,7 +21,7 @@ from app.api.routes.progressive_storage import s_api_v1_5_storage_get, s_api_v1_
|
||||
from app.api.routes.account import s_api_v1_account_get
|
||||
from app.api.routes._blockchain import s_api_v1_blockchain_send_new_content_message, \
|
||||
s_api_v1_blockchain_send_purchase_content_message
|
||||
from app.api.routes.content import s_api_v1_content_list, s_api_v1_content_view, s_api_v1_content_friendly_list
|
||||
from app.api.routes.content import s_api_v1_content_list, s_api_v1_content_view, s_api_v1_content_friendly_list, s_api_v1_5_content_list
|
||||
from app.api.routes.tonconnect import s_api_v1_tonconnect_new, s_api_v1_tonconnect_logout
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ app.add_route(s_api_v1_blockchain_send_purchase_content_message, "/api/v1/blockc
|
||||
app.add_route(s_api_v1_content_list, "/api/v1/content.list", methods=["GET", "OPTIONS"])
|
||||
app.add_route(s_api_v1_content_view, "/api/v1/content.view/<content_address>", methods=["GET", "OPTIONS"])
|
||||
app.add_route(s_api_v1_content_friendly_list, "/api/v1/content.friendlyList", methods=["GET", "OPTIONS"])
|
||||
app.add_route(s_api_v1_5_content_list, "/api/v1.5/content.list", methods=["GET", "OPTIONS"])
|
||||
|
||||
|
||||
@app.exception(BaseException)
|
||||
|
||||
@@ -167,6 +167,10 @@ async def s_api_v1_content_friendly_list(request):
|
||||
for content in request.ctx.db_session.query(StoredContent).filter(
|
||||
StoredContent.type == 'onchain/content'
|
||||
).all():
|
||||
if not content.meta.get('metadata_cid'):
|
||||
make_log("Content", f"Content {content.cid.serialize_v2()} has no metadata", level='warning')
|
||||
continue
|
||||
|
||||
metadata_content = StoredContent.from_cid(request.ctx.db_session, content.meta.get('metadata_cid'))
|
||||
with open(metadata_content.filepath, 'r') as f:
|
||||
metadata = json.loads(f.read())
|
||||
|
||||
Reference in new issue
Block a user