scanner.py

This commit is contained in:
2026-02-18 12:03:49 +01:00
parent c82875e7f7
commit da6ff83033
2 changed files with 47 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# 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