mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 21:50:28 +02:00
Prevent cancellation if process is at 99%
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# v1.0.7 (pre-release)
|
# v1.0.7 (pre-release)
|
||||||
- Improve chaptered audio generation by outputting directly as `m4b` instead of converting from `wav`.
|
- 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.
|
- 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 `.opus` as output format for generated audio files.
|
||||||
- Added "Playing..." indicator for "Preview" button in the voice mixer.
|
- Added "Playing..." indicator for "Preview" button in the voice mixer.
|
||||||
|
|
||||||
|
|||||||
@@ -1127,12 +1127,20 @@ class abogen(QWidget):
|
|||||||
QApplication.processEvents()
|
QApplication.processEvents()
|
||||||
|
|
||||||
def update_progress(self, value, etr_str): # Add etr_str parameter
|
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.setValue(value)
|
||||||
self.progress_bar.setFormat("%p%") # Keep format as percentage only
|
self.progress_bar.setFormat("%p%") # Keep format as percentage only
|
||||||
self.etr_label.setText(
|
self.etr_label.setText(
|
||||||
f"Estimated time remaining: {etr_str}"
|
f"Estimated time remaining: {etr_str}"
|
||||||
) # Update ETR label
|
) # Update ETR label
|
||||||
self.etr_label.show() # Show only when estimate is ready
|
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()
|
self.progress_bar.repaint()
|
||||||
QApplication.processEvents()
|
QApplication.processEvents()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user