dev@locazia: metadata fix
This commit is contained in:
parent
9055b03114
commit
8b380ebc4b
|
|
@ -77,7 +77,7 @@ async def s_api_v1_blockchain_send_new_content_message(request):
|
|||
|
||||
metadata_content = await create_metadata_for_item(
|
||||
request.ctx.db_session,
|
||||
title=f"{', '.join(request.json['authors'])} - {request.json['title']}",
|
||||
title=f"{', '.join(request.json['authors'])} - {request.json['title']}" if request.json['authors'] else request.json['title'],
|
||||
cover_url=f"{PROJECT_HOST}/api/v1/storage/{image_content_cid.serialize_v2()}" if image_content_cid else None,
|
||||
authors=request.json['authors']
|
||||
)
|
||||
|
|
|
|||
|
|
@ -109,14 +109,14 @@ async def s_api_v1_storage_get(request, file_hash=None):
|
|||
content_file_bin = await file.read()
|
||||
|
||||
accept_type = cid.accept_type or request.headers.get("Accept")
|
||||
accept_type = accept_type or "application/octet-stream"
|
||||
accept_type = accept_type or content.meta.get("content_type")
|
||||
if accept_type:
|
||||
if accept_type == "application/json":
|
||||
return response.json(
|
||||
json.loads(content_file_bin.decode())
|
||||
)
|
||||
|
||||
return response.raw(body=content_file_bin, content_type=accept_type)
|
||||
return response.raw(body=content_file_bin, **({'content_type': accept_type} if accept_type else {}))
|
||||
|
||||
|
||||
async def s_api_v1_storage_decode_cid(request, content_id=None):
|
||||
|
|
|
|||
Loading…
Reference in New Issue