test/custom-admin-ui #3

Merged
orion merged 673 commits from test/custom-admin-ui into master 2026-06-05 17:20:58 +08:00
Showing only changes of commit cfecb03613 - Show all commits
+10
View File
@@ -75,11 +75,21 @@ class FileSystemStorage:
filepath = await self.get_filepath(text)
if filepath.exists():
await asyncio.to_thread(os.remove, filepath)
await asyncio.to_thread(self.judge_delete_folder, filepath)
async def delete_files(self, texts):
tasks = [self.delete_file(text) for text in texts]
await asyncio.gather(*tasks)
def judge_delete_folder(self, filepath):
currpath = os.path.dirname(filepath)
if os.listdir(currpath):
return
while str(currpath) != (str(self.DATA_ROOT) + '\\upload'):
if not os.listdir(currpath):
os.rmdir(os.path.abspath(currpath))
currpath = os.path.dirname(currpath)
STORAGE_ENGINE = {
"filesystem": FileSystemStorage