Skip to content

Commit 49a6224

Browse files
CopilotLeafCreeper
andcommitted
refactor: expose last_transcript as public property for cleaner API
Co-authored-by: LeafCreeper <120477804+LeafCreeper@users.noreply.github.com>
1 parent 8b059a5 commit 49a6224

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def process_lecture(
126126
else:
127127
print(f" {tag} [FAIL] All {max_attempts} attempts got incomplete audio, using best result.")
128128
# Use the partial transcript rather than failing entirely
129-
transcript = transcriber._last_transcript
129+
transcript = transcriber.last_transcript
130130
db.update_transcript(sub_id, transcript)
131131
except NoAudioStreamError as e:
132132
print(f" {tag} [SKIP] Video-only (no audio stream): {e}")

src/transcriber.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ def _media_duration(self):
6060
def _media_duration(self, value):
6161
self._local.media_duration = value
6262

63+
@property
64+
def last_transcript(self):
65+
"""Public access to the transcript from the most recent transcription
66+
on the *current* thread. Used as a fallback when all retry attempts
67+
for incomplete audio fail."""
68+
return self._last_transcript
69+
6370
# -- initialisation ---------------------------------------------------
6471

6572
def _init(self):

0 commit comments

Comments
 (0)