Skip to content

Commit

Permalink
Solve issue MangaManagerORG#207
Browse files Browse the repository at this point in the history
Issue Resolved: MangaManagerORG#207 

Changes Made:
- Implemented the ability to read folders with escape characters in their names.

Reference: 
https://stackoverflow.com/questions/2595119/glob-and-bracket-characters
  • Loading branch information
alanqq0624 authored Apr 8, 2024
1 parent df2a88b commit 0b786f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MangaManager/src/MetadataManager/MetadataManagerGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def select_folder(self):
# Open select files dialog

folder_path = askdirectory(initialdir=initial_dir)
self.selected_files_path = glob.glob(root_dir=folder_path, pathname=os.path.join(folder_path, "**/*.cbz"),
self.selected_files_path = glob.glob(root_dir=folder_path, pathname=os.path.join(glob.escape(folder_path), "**/*.cbz"),
recursive=True)
# TODO: Auto select recursive or not
# self.selected_files_path = [str(Path(folder_path, file)) for file in os.listdir(folder_path) if file.endswith(".cbz")]
Expand Down Expand Up @@ -510,4 +510,4 @@ def clean_selected(self):
self.widget_mngr.clean_widgets()
self.image_cover_frame.clear()
self.selected_files_path = list()
self.selected_files_treeview.clear()
self.selected_files_treeview.clear()

0 comments on commit 0b786f0

Please sign in to comment.