Skip to content

Commit

Permalink
fix scanning nested folders
Browse files Browse the repository at this point in the history
  • Loading branch information
gantoine committed Jan 16, 2025
1 parent 9d8baef commit 0bb938f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/handler/filesystem/roms_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,12 @@ def get_rom_files(self, rom: str, roms_path: str) -> list[RomFile]:

# Check if rom is a multi-part rom
if os.path.isdir(f"{abs_fs_path}/{rom}"):
multi_files = os.listdir(f"{abs_fs_path}/{rom}")
for file in self._exclude_files(multi_files, "multi_parts"):
rom_files.append(self._build_rom_file(f"{roms_path}/{rom}", file))
for f_path, file in iter_files(f"{abs_fs_path}/{rom}", recursive=True):
rom_files.append(
self._build_rom_file(
str(f_path.relative_to(LIBRARY_BASE_PATH)), file
)
)
else:
rom_files.append(self._build_rom_file(roms_path, rom))

Expand Down

0 comments on commit 0bb938f

Please sign in to comment.