mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 13:40:27 +02:00
Prevent cancellation if process is at 99%
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# v1.0.7 (pre-release)
|
||||
- Improve chaptered audio generation by outputting directly as `m4b` instead of converting from `wav`.
|
||||
- Ignore chapter markers and single newlines when calculating text length, improving the accuracy of the text length calculation.
|
||||
- Prevent cancellation if process is at 99%, ensuring the process is not interrupted at the last moment.
|
||||
- Added `.opus` as output format for generated audio files.
|
||||
- Added "Playing..." indicator for "Preview" button in the voice mixer.
|
||||
|
||||
|
||||
@@ -1127,12 +1127,20 @@ class abogen(QWidget):
|
||||
QApplication.processEvents()
|
||||
|
||||
def update_progress(self, value, etr_str): # Add etr_str parameter
|
||||
# Ensure progress doesn't exceed 99%
|
||||
if value >= 100:
|
||||
value = 99
|
||||
self.progress_bar.setValue(value)
|
||||
self.progress_bar.setFormat("%p%") # Keep format as percentage only
|
||||
self.etr_label.setText(
|
||||
f"Estimated time remaining: {etr_str}"
|
||||
) # Update ETR label
|
||||
self.etr_label.show() # Show only when estimate is ready
|
||||
|
||||
# Disable cancel button if progress is >= 98%
|
||||
if value >= 98:
|
||||
self.btn_cancel.setEnabled(False)
|
||||
|
||||
self.progress_bar.repaint()
|
||||
QApplication.processEvents()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user