From 485a9ec96deebd0211858a69f4ef6b32150031e7 Mon Sep 17 00:00:00 2001 From: Tom Moroney <72154813+tmoroney@users.noreply.github.com> Date: Thu, 1 Feb 2024 17:30:56 +0000 Subject: [PATCH] Fixed bug caused by non 0 starting timecode --- auto-subs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/auto-subs.py b/auto-subs.py index d82b4c8..bc294e4 100644 --- a/auto-subs.py +++ b/auto-subs.py @@ -287,7 +287,8 @@ def OnTranscribe(ev): print("There was an error transcribing the timeline!") itm['DialogBox'].Text = "Error: No subtitles were returned!" return - + + markIn = markIn - timeline.GetStartFrame() # Adjust the timestamps in the SRT file to start at MarkIn (in seconds) time_delta = timedelta(seconds=markIn / frame_rate) adjusted_content = adjust_subtitle_timestamps(original_content, time_delta) @@ -492,7 +493,7 @@ def OnPopulateSubs(ev): clipList = timeline.GetItemListInTrack('video', timelineTrack) # get list of Text+ in timeline # Return if no Text+ clips found - if len(clipList) == 0: + if clipList is None or len(clipList) == 0: itm["Tree"].Clear() itRow = itm["Tree"].NewItem() itRow.Text[0] = "No subtitles"