Skip to content

Commit

Permalink
Only warn once about save location and FFMpeg command
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlGao4 committed May 18, 2024
1 parent b271790 commit a0e879d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions GUI/GuiMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,7 @@ def mix(self, origin: "separator.torch.Tensor", separated: "dict[str, separator.


class SeparationControl(QWidget):
startSeparateSignal = Signal()
startSeparateSignal = Signal(bool)
currentFinishedSignal = Signal(int, QTableWidgetItem)
setModelProgressSignal = Signal(float)
setAudioProgressSignal = Signal(float, QTableWidgetItem)
Expand Down Expand Up @@ -1946,9 +1946,9 @@ def currentFinished(self, status, item: QTableWidgetItem):
main_window.updateQueueLength()
if status != shared.FileStatus.Finished:
self.start_button.setEnabled(True)
self.startSeparateSignal.emit()
self.startSeparateSignal.emit(True)

def startSeparation(self):
def startSeparation(self, no_warning=False):
global main_window
if not self.start_button.isEnabled():
return
Expand All @@ -1957,7 +1957,7 @@ def startSeparation(self):
main_window.setStatusText.emit("No more file to separate")
separator.empty_cache()
return
if "{stem}" not in main_window.save_options.loc_input.currentText():
if "{stem}" not in main_window.save_options.loc_input.currentText() and not no_warning:
main_window.showWarning.emit("Warning", '"{stem}" not included in save location. May cause overwrite.')
if main_window.save_options.encoder_group.checkedId() == 1:
if not shared.is_sublist(["-i", "-"], shared.try_parse_cmd(main_window.save_options.command.text())):
Expand All @@ -1966,7 +1966,7 @@ def startSeparation(self):
'Command must contain "-i -" for ffmpeg encoder. You are not saving output audio.',
)
return
if "-v" not in shared.try_parse_cmd(main_window.save_options.command.text()):
if "-v" not in shared.try_parse_cmd(main_window.save_options.command.text()) and not no_warning:
main_window.showWarning.emit(
"Warning",
'Command does not contain "-v" for ffmpeg encoder. May output too much information to log file.',
Expand Down

0 comments on commit a0e879d

Please sign in to comment.