Fix for exporting just resized segments (#912)

This commit is contained in:
Raivis Dejus 2024-09-28 15:05:34 +03:00 committed by GitHub
commit b592550299
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 13 deletions

View file

@ -1 +1 @@
VERSION = "1.1.0"
VERSION = "1.1.1"

View file

@ -23,17 +23,8 @@ class ExportTranscriptionMenu(QMenu):
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")
@ -54,6 +45,17 @@ class ExportTranscriptionMenu(QMenu):
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('-')
@ -81,6 +83,9 @@ class ExportTranscriptionMenu(QMenu):
if output_file_path == "":
return
# Reload segments in case they were resized
self.load_segments()
write_output(
path=output_file_path,
segments=self.segments,

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "buzz-captions"
version = "1.1.0"
version = "1.1.1"
description = ""
authors = ["Chidi Williams <williamschidi1@gmail.com>"]
license = "MIT"