All tests pass

This commit is contained in:
Keith Edmunds 2025-08-19 18:24:09 +01:00
parent 4978dcf5c3
commit 2f9fcae05f

View File

@ -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"<DoTrackImport(id={hex(id(self))}, import_file_path={self.import_file_path}"
return (
f"<DoTrackImport(id={hex(id(self))}, "
f"import_file_path={self.import_file_path}"
)
def run(self) -> 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):