8000 fix: 修复上传路径 · TTB-Network/python-openbmclapi@93bb0ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 93bb0ec

Browse files
committed
fix: 修复上传路径
1 parent 917cb3e commit 93bb0ec

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

core/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ async def upload_storage(
589589
retries = 0
590590
while 1:
591591
try:
592-
await storage.storage.upload(f"download/{file.hash[:2]}/{file.hash}", tmp_file, size)
592+
await storage.storage.upload_download_file(f"{file.hash[:2]}/{file.hash}", tmp_file, size)
593593
break
594594
except:
595595
if retries >= 10:

core/storage/abc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ async def upload(
156156
):
157157
raise NotImplementedError
158158

159+
async def upload_download_file(self, path: str, tmp_file: tempfile._TemporaryFileWrapper, size: int):
160+
if self.download_dir:
161+
path = f"download/{path}"
162+
await self.upload(f"download/{path}", tmp_file, size)
163+
159164
async def get_response_file(
160165
self,
161166
hash: str

0 commit comments

Comments
 (0)
0