Skip to content

Commit

Permalink
settings: actually use dir_path as wd for post_process commands
Browse files Browse the repository at this point in the history
  • Loading branch information
TAAPArthur committed Oct 26, 2024
1 parent 34e2531 commit 5a21dee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion amt/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ def download_chapter(self, media_data, chapter_data, **kwargs):
page_paths = self.download_pages(media_data, chapter_data, **kwargs)
self.post_download(media_data, chapter_data, page_paths=page_paths)

self.settings.post_process(media_data, page_paths, self.settings.get_media_dir(media_data))
self.settings.post_process(media_data, page_paths, dir_path)

self.mark_download_complete(media_data, chapter_data)
self.logger.info("%s %d %s is downloaded; Total pages %d", media_data["name"], chapter_data["number"], chapter_data["title"], len(page_paths))
Expand Down
2 changes: 1 addition & 1 deletion amt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,4 @@ def open_viewer(self, raw_files, server_media_chapters, raw_viewer=False):
def post_process(self, media_data, file_paths, dir_path):
cmd = self.get_field("post_process_cmd", media_data)
if cmd:
self.run_cmd(cmd.format(files=" ".join(map(Settings._smart_quote, file_paths)), wd=dir_path, raiseException=True))
self.run_cmd(cmd.format(files=" ".join(map(Settings._smart_quote, file_paths))), wd=dir_path, raiseException=True)

0 comments on commit 5a21dee

Please sign in to comment.