From 2f9fcae05fe6cb30f93414ccc8b67de01df58327 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Tue, 19 Aug 2025 18:24:09 +0100 Subject: [PATCH] All tests pass --- app/file_importer.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/file_importer.py b/app/file_importer.py index c1ed6e9..ee81c17 100644 --- a/app/file_importer.py +++ b/app/file_importer.py @@ -244,7 +244,8 @@ class FileImporter: if not tfd.file_path_to_remove: return True - if tfd.file_path_to_remove.endswith(audio_file_extension(tfd.source_path)): + extension = audio_file_extension(tfd.source_path) + if extension and tfd.file_path_to_remove.endswith(extension): return True tfd.error = ( @@ -511,7 +512,8 @@ class FileImporter: msgs: list[str] = [] for tfd in tfds: msgs.append( - f"{os.path.basename(tfd.source_path)} will not be imported because {tfd.error}" + f"{os.path.basename(tfd.source_path)} will not be imported " + f"because {tfd.error}" ) if msgs: show_OK("File not imported", "\r\r".join(msgs)) @@ -534,7 +536,8 @@ class FileImporter: filename = os.path.basename(tfd.source_path) log.debug(f"Processing {filename}") log.debug( - f"remaining files: {[a.source_path for a in self.import_files_data]}" + "remaining files: " + f"{[a.source_path for a in self.import_files_data]}" ) self.signals.status_message_signal.emit( f"Importing {filename}", 10000 @@ -631,7 +634,10 @@ class DoTrackImport(QThread): self.signals = MusicMusterSignals() def __repr__(self) -> str: - return f" None: """ @@ -647,7 +653,7 @@ class DoTrackImport(QThread): # Get audio metadata in this thread rather than calling # function to save interactive time - self.audio_metadata = helpers.get_audio_metadata(self.import_file_path) + self.audio_metadata = get_audio_metadata(self.import_file_path) # Remove old file if so requested if self.file_path_to_remove and os.path.exists(self.file_path_to_remove):