mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-03-14 22:55:46 +01:00
Fix for exporting just resized segments (#912)
This commit is contained in:
parent
d1916ee940
commit
b592550299
3 changed files with 18 additions and 13 deletions
|
|
@ -1 +1 @@
|
|||
VERSION = "1.1.0"
|
||||
VERSION = "1.1.1"
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue