scanner.py
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user