22 lines
540 B
Python
22 lines
540 B
Python
# core/scanner.py
|
|
|
|
import os
|
|
|
|
VALID_EXTENSIONS = {".cbr", ".cbz"}
|
|
|
|
def find_comic_files(base_path):
|
|
"""
|
|
Recorre recursivamente un directorio y devuelve una lista
|
|
con todos los archivos .cbr y .cbz encontrados.
|
|
"""
|
|
comic_files = []
|
|
|
|
for root, _, files in os.walk(base_path):
|
|
for file in files:
|
|
ext = os.path.splitext(file)[1].lower()
|
|
if ext in VALID_EXTENSIONS:
|
|
full_path = os.path.join(root, file)
|
|
comic_files.append(full_path)
|
|
|
|
return comic_files
|