fix magic
This commit is contained in:
parent
d2ff332490
commit
4483c194da
|
|
@ -49,7 +49,7 @@ async def convert_loop(memory):
|
||||||
|
|
||||||
# ==== Новая логика: определение MIME-тип через python-magic ====
|
# ==== Новая логика: определение MIME-тип через python-magic ====
|
||||||
try:
|
try:
|
||||||
mime_type = magic.from_file(input_file_path, mime=True)
|
mime_type = magic.from_file(input_file_path.replace("/Storage/storedContent", "/app/data"), mime=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
make_log("ConvertProcess", f"magic probe failed: {e}", level="warning")
|
make_log("ConvertProcess", f"magic probe failed: {e}", level="warning")
|
||||||
mime_type = ""
|
mime_type = ""
|
||||||
|
|
@ -65,7 +65,7 @@ async def convert_loop(memory):
|
||||||
|
|
||||||
# Для прочих типов сохраняем raw копию и выходим
|
# Для прочих типов сохраняем raw копию и выходим
|
||||||
if content_kind == "other":
|
if content_kind == "other":
|
||||||
make_log("ConvertProcess", f"Content {unprocessed_encrypted_content.id} processed. Converted content: {converted_content}", level="info")
|
make_log("ConvertProcess", f"Content {unprocessed_encrypted_content.id} processed. Not audio/video, copy just", level="info")
|
||||||
unprocessed_encrypted_content.btfs_cid = ContentId(
|
unprocessed_encrypted_content.btfs_cid = ContentId(
|
||||||
version=2, content_hash=b58decode(converted_content['high' if content_kind=='video' else 'low'])
|
version=2, content_hash=b58decode(converted_content['high' if content_kind=='video' else 'low'])
|
||||||
).serialize_v2()
|
).serialize_v2()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue