Skip to content

Commit

Permalink
Prevent adding Items to the Queue with the same Input & Output File path
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkl58 committed Oct 27, 2022
1 parent 299fc52 commit 0f3817c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions NotEnoughAV1Encodes/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,13 @@ private void AddToQueue(string identifier, bool skipSubs)
return;
}

if (videoDB.InputPath == videoDB.OutputPath)
{
// Throw Error
MessageBox.Show(LocalizedStrings.Instance["MessageSameInputOutput"], LocalizedStrings.Instance["Error"], MessageBoxButton.OK, MessageBoxImage.Error);
return;
}

Queue.QueueElement queueElement = new();
Audio.CommandGenerator audioCommandGenerator = new();
Subtitle.CommandGenerator subCommandGenerator = new();
Expand Down
3 changes: 3 additions & 0 deletions NotEnoughAV1Encodes/resources/lang/Strings.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ Please download and extract 7-zip to the following path:
<data name="FinishedEncoding" xml:space="preserve">
<value>Encode fertig - Verstrichene Zeit</value>
</data>
<data name="MessageSameInputOutput" xml:space="preserve">
<value>Dateieingabe- und Ausgabepfad sind identisch!</value>
</data>
<data name="MuxingErrorDetected" xml:space="preserve">
<value>Möglicher Muxing-Fehler</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions NotEnoughAV1Encodes/resources/lang/Strings.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ Please download and extract 7-zip to the following path:
<data name="FinishedEncoding" xml:space="preserve">
<value>Encodage terminé - Temps écoulé</value>
</data>
<data name="MessageSameInputOutput" xml:space="preserve">
<value>Les chemins d'entrée et de sortie des fichiers sont les mêmes!</value>
</data>
<data name="MuxingErrorDetected" xml:space="preserve">
<value>Erreur de multiplexage possible</value>
</data>
Expand Down
3 changes: 3 additions & 0 deletions NotEnoughAV1Encodes/resources/lang/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -536,4 +536,7 @@ Please download and extract 7-zip to the following path:
<data name="FinishedEncoding" xml:space="preserve">
<value>Finished Encoding - Elapsed Time</value>
</data>
<data name="MessageSameInputOutput" xml:space="preserve">
<value>Input and Output Path are the same!</value>
</data>
</root>

0 comments on commit 0f3817c

Please sign in to comment.