Skip to content

Commit

Permalink
fixed issue with get version method
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilJohan committed Jul 30, 2024
1 parent 8d3e8cf commit 47c8844
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def create_cuda_indicator(self):

def create_ffmpeg_indicator(self):
"""
Create an indicator light to show the status of the CUDA check.
Create an indicator to show the status of FFmpeg, and calls the method to use either the newest version of ffmpeg
or packaged version
"""
self.ffmpeg_indicator = QLabel(self)
self.ffmpeg_indicator.setFixedSize(22, 22) # Increase size to include space for border and padding
Expand All @@ -136,6 +137,7 @@ def create_ffmpeg_indicator(self):
pixmap = QPixmap(icon_path).scaled(20, 20, Qt.KeepAspectRatio, Qt.SmoothTransformation)

ffmpeg_path, is_packaged_version = Utils.get_ffmpeg_path(include_packaged_version=True)
self.ffmpeg_path = ffmpeg_path

if is_packaged_version:
self.ffmpeg_indicator.setStyleSheet("""
Expand Down
5 changes: 2 additions & 3 deletions Smelt.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self):
self.audio_file_path = None
self.folder_path = None
self.film_file_path = None
self.ffmpeg_path = ffmpeg_path
self.ffmpeg_path = None

"""
Initialize UI elements
Expand Down Expand Up @@ -205,7 +205,7 @@ def recognize_and_combine_audio_files(self, selected_audio_file):
proceed_combine = self.exist_check(combined_audio_file)

ffmpeg_combine_audio_cmd = [
ffmpeg_path,
self.ffmpeg_path,
'-i', matching_files['L'],
'-i', matching_files['R'],
'-i', matching_files['C'],
Expand Down Expand Up @@ -661,7 +661,6 @@ def enqueue_output(pipe, queue):


Utils.setup()
ffmpeg_path = Utils.get_ffmpeg_path()
app = QApplication(sys.argv)
app.setStyle('Breeze')

Expand Down
6 changes: 3 additions & 3 deletions Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def get_version(ffmpeg_path):
version = version_line.split()[2]
version_numbers = tuple(map(int, (version.split('-')[0]).split('.')))
return version_numbers
except Exception as e:
print(e)
return None
except FileNotFoundError:
print(f"FFmpeg executable not found at path: {ffmpeg_path}")
return None

installed_ffmpeg_path = 'ffmpeg'

Expand Down
4 changes: 2 additions & 2 deletions resources/Smelt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ if is_linux:
a.datas,
[],
name='Smelt',
debug=all,
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
Expand Down

0 comments on commit 47c8844

Please sign in to comment.