Skip to content

Commit

Permalink
Fix for exporting just resized segments (#912)
Browse files Browse the repository at this point in the history
  • Loading branch information
raivisdejus authored Sep 28, 2024
1 parent d1916ee commit b592550
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion buzz/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "1.1.0"
VERSION = "1.1.1"
27 changes: 16 additions & 11 deletions buzz/widgets/transcription_viewer/export_transcription_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,8 @@ def __init__(

self.transcription = transcription
self.transcription_service = transcription_service

self.segments = [
Segment(
start=segment.start_time,
end=segment.end_time,
text=segment.text,
translation=segment.translation)
for segment in self.transcription_service.get_transcription_segments(
transcription_id=self.transcription.id_as_uuid
)
]
self.segments = []
self.load_segments()

if self.segments and len(self.segments[0].translation) > 0:
text_label = _("Text")
Expand All @@ -54,6 +45,17 @@ def __init__(
self.addActions(actions)
self.triggered.connect(self.on_menu_triggered)

def load_segments(self):
self.segments = [
Segment(
start=segment.start_time,
end=segment.end_time,
text=segment.text,
translation=segment.translation)
for segment in self.transcription_service.get_transcription_segments(
transcription_id=self.transcription.id_as_uuid
)
]
@staticmethod
def extract_format_and_segment_key(action_text: str):
parts = action_text.split('-')
Expand Down Expand Up @@ -81,6 +83,9 @@ def on_menu_triggered(self, action: QAction):
if output_file_path == "":
return

# Reload segments in case they were resized
self.load_segments()

write_output(
path=output_file_path,
segments=self.segments,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "buzz-captions"
version = "1.1.0"
version = "1.1.1"
description = ""
authors = ["Chidi Williams <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit b592550

Please sign in to comment.