修复了文件夹不存在时无法保存的问题

This commit is contained in:
Yorusora
2025-05-20 21:39:22 +08:00
parent 497e1ced27
commit 6215399cf7
7 changed files with 35 additions and 0 deletions

View File

@ -322,6 +322,9 @@ class Data:
return Result().success(info=Constants.CUT_PSG_ALIGN_LABEL_FINISHED)
def save(self):
if (not Path(Config["Path"]["SaveFolder"]).exists()) or (not Path(Config["Path"]["SaveFolder"]).is_dir()):
Path(Config["Path"]["SaveFolder"]).mkdir(parents=True, exist_ok=True)
for raw in self.raw.values():
if len(raw) == 0:
return Result().failure(info=Constants.SAVING_FAILURE +