Scan sub-folders recursively when showing the data files link

This commit is contained in:
Kovid Goyal 2023-04-25 20:38:38 +05:30
parent 82392bdd61
commit 6c9bd54cb6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -219,8 +219,8 @@ def mi_to_html(
else: else:
data_path = os.path.join(path, DATA_DIR_NAME) data_path = os.path.join(path, DATA_DIR_NAME)
with suppress(OSError): with suppress(OSError):
for de in os.scandir(data_path): for dirpath, dirnames, filenames in os.walk(data_path):
if de.is_file(): if filenames:
num_of_folders = 2 num_of_folders = 2
break break
text = _('Book files') text = _('Book files')