Skip to content

Commit

Permalink
Fixed bug caused by non 0 starting timecode
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoroney authored Feb 1, 2024
1 parent 1e13eff commit 485a9ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions auto-subs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 485a9ec

Please sign in to comment.