Skip to content

Commit

Permalink
🐛 修复了创建epub只有没有返回原来工作路径的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wiseCirno committed Dec 3, 2024
1 parent a2d6c21 commit 3b78678
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/service/telegraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ async def create_epub():
manga.add_item(epub.EpubNav())
manga.add_item(epub.EpubNcx())

back = os.getcwd()
os.mkdir(self._file_dir) if not os.path.exists(self._file_dir) else None
os.chdir(self._file_dir)
epub.write_epub(f"{self.title}.epub", manga, {})
os.chdir(os.getcwd())
os.chdir(back)
logger.debug(f"[Telegraph]: Create EPUB file at '{self._file_path}'")

async def fun_handler(func, *args):
Expand Down

0 comments on commit 3b78678

Please sign in to comment.