aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/__main__.py3
-rw-r--r--src/components/video.py6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/__main__.py b/src/__main__.py
index bd35e32..284fd2c 100644
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -21,6 +21,9 @@ def main() -> int:
mode = 'commandline'
else:
# remove unsafe punctuation characters such as \/?*&^%$#
+ if sys.argv[1].endswith('.avp'):
+ # remove file extension
+ sys.argv[1] = sys.argv[1][:-4]
sys.argv[1] = re.sub(f'[{re.escape(string.punctuation)}]', '', sys.argv[1])
# opening a project file with gui
proj = sys.argv[1]
diff --git a/src/components/video.py b/src/components/video.py
index 9fffc26..60ca800 100644
--- a/src/components/video.py
+++ b/src/components/video.py
@@ -63,16 +63,16 @@ class Component(Component):
def properties(self):
props = []
+ outputFile = None
if hasattr(self.parent, 'lineEdit_outputFile'):
+ # check only happens in GUI mode
outputFile = self.parent.lineEdit_outputFile.text()
- else:
- outputFile = str(self.parent.args.output)
if not self.videoPath:
self.lockError("There is no video selected.")
elif not os.path.exists(self.videoPath):
self.lockError("The video selected does not exist!")
- elif os.path.realpath(self.videoPath) == os.path.realpath(outputFile):
+ elif outputFile and os.path.realpath(self.videoPath) == os.path.realpath(outputFile):
self.lockError("Input and output paths match.")
if self.useAudio: