Fixed bug where print cover could not be fetched in Docker environments

This commit is contained in:
maziggy
2026-01-04 18:56:11 +01:00
parent a18d0c0939
commit ffd0c8bddf
+3
View File
@@ -1,5 +1,6 @@
import asyncio
import logging
import os
import socket
import ssl
from collections.abc import Callable
@@ -170,6 +171,8 @@ class BambuFTPClient:
local_path.parent.mkdir(parents=True, exist_ok=True)
with open(local_path, "wb") as f:
self._ftp.retrbinary(f"RETR {remote_path}", f.write)
f.flush()
os.fsync(f.fileno())
file_size = local_path.stat().st_size if local_path.exists() else 0
logger.info(f"Successfully downloaded {remote_path} to {local_path} ({file_size} bytes)")
return True