All tests pass
This commit is contained in:
parent
4978dcf5c3
commit
2f9fcae05f
@ -244,7 +244,8 @@ class FileImporter:
|
|||||||
if not tfd.file_path_to_remove:
|
if not tfd.file_path_to_remove:
|
||||||
return True
|
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
|
return True
|
||||||
|
|
||||||
tfd.error = (
|
tfd.error = (
|
||||||
@ -511,7 +512,8 @@ class FileImporter:
|
|||||||
msgs: list[str] = []
|
msgs: list[str] = []
|
||||||
for tfd in tfds:
|
for tfd in tfds:
|
||||||
msgs.append(
|
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:
|
if msgs:
|
||||||
show_OK("File not imported", "\r\r".join(msgs))
|
show_OK("File not imported", "\r\r".join(msgs))
|
||||||
@ -534,7 +536,8 @@ class FileImporter:
|
|||||||
filename = os.path.basename(tfd.source_path)
|
filename = os.path.basename(tfd.source_path)
|
||||||
log.debug(f"Processing {filename}")
|
log.debug(f"Processing {filename}")
|
||||||
log.debug(
|
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(
|
self.signals.status_message_signal.emit(
|
||||||
f"Importing {filename}", 10000
|
f"Importing {filename}", 10000
|
||||||
@ -631,7 +634,10 @@ class DoTrackImport(QThread):
|
|||||||
self.signals = MusicMusterSignals()
|
self.signals = MusicMusterSignals()
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
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:
|
def run(self) -> None:
|
||||||
"""
|
"""
|
||||||
@ -647,7 +653,7 @@ class DoTrackImport(QThread):
|
|||||||
|
|
||||||
# Get audio metadata in this thread rather than calling
|
# Get audio metadata in this thread rather than calling
|
||||||
# function to save interactive time
|
# 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
|
# Remove old file if so requested
|
||||||
if self.file_path_to_remove and os.path.exists(self.file_path_to_remove):
|
if self.file_path_to_remove and os.path.exists(self.file_path_to_remove):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user