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:
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user