Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Summary skip runs finish_processing; reprocess queue error is sanitized

Murtaza Nasir3b027d249c13
diff --git a/src/services/reprocessing.py b/src/services/reprocessing.py
index dc24f316..64130c05 100644
--- a/src/services/reprocessing.py
+++ b/src/services/reprocessing.py
@@ -62,7 +62,8 @@ def queue_transcription_reprocess(recording, user, overrides=None):
db.session.rollback()
recording = db.session.get(type(recording), recording.id)
recording.status = 'FAILED'
- recording.error_message = f'Could not queue reprocessing: {e}'
+ from src.tasks.processing import _sanitize_error_message
+ recording.error_message = _sanitize_error_message(f'Could not queue reprocessing: {e}')
db.session.commit()
raise ReprocessError('Could not queue reprocessing; please try again', 503) from e
diff --git a/src/tasks/processing.py b/src/tasks/processing.py
index 7a2d16f2..844b9835 100644
--- a/src/tasks/processing.py
+++ b/src/tasks/processing.py
@@ -630,11 +630,12 @@ def generate_summary_only_task(app_context, recording_id, custom_prompt_override
if client is None:
current_app.logger.warning(f"Skipping summary generation for {recording_id}: OpenRouter client not configured.")
recording.summary = "[Summary skipped: OpenRouter client not configured]"
- # enqueue set SUMMARIZING; without this the recording never leaves it.
- recording.status = 'COMPLETED'
db.session.commit()
+ # enqueue set SUMMARIZING; like the other exits, finish_processing
+ # sets COMPLETED and runs the steps that follow it (#412).
+ finish_processing(recording_id)
from src.services.webhook_dispatch import emit_summary_result
- emit_summary_result(recording, ok=False, error="LLM client not configured")
+ emit_summary_result(db.session.get(Recording, recording_id), ok=False, error="LLM client not configured")
return
recording.status = 'SUMMARIZING'