fix: Detección estricta de archivos ya procesados

- Compara nombres exactos (stem.txt) en vez de substrings
- Agrega verificación en callback de descarga
- Evita re-procesamiento de archivos

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
renato97
2026-02-25 17:28:04 +00:00
parent 1f6bfa771b
commit d902203b59
2 changed files with 16 additions and 31 deletions

View File

@@ -202,23 +202,14 @@ class RemoteFolderWatcher:
# Verificar si ya existe el archivo localmente
if local_path.exists():
# Verificar si ya fue procesado (existe transcripción)
# Verificar si ya fue procesado (existe transcripción con nombre EXACTO)
stem = local_path.stem
transcriptions_dir = self.local_path.parent / "transcriptions"
processed = False
txt_path = transcriptions_dir / f"{stem}.txt"
if transcriptions_dir.exists():
for f in transcriptions_dir.iterdir():
if f.suffix == ".txt" and stem in f.stem:
processed = True
break
if processed:
if txt_path.exists():
self.logger.info(f"Skipping already processed file: {filename}")
return
else:
# Existe pero no procesado, re-descargar
self.logger.info(f"Re-downloading incomplete file: {filename}")
self.logger.info(f"Downloading: {remote_path}")