Fix file importing
Imported track wasn't moved to destination
This commit is contained in:
parent
e25d4ad311
commit
d050fa0d84
@ -184,15 +184,16 @@ class ImportTrack(QObject):
|
|||||||
f"Importing {basename(tf.source_file_path)}", 5000
|
f"Importing {basename(tf.source_file_path)}", 5000
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Sanity check
|
||||||
|
if not os.path.exists(tf.source_file_path):
|
||||||
|
log.error(f"ImportTrack: file not found: {tf.source_file_path=}")
|
||||||
|
continue
|
||||||
|
|
||||||
# Move the track file. Check that we're not importing a
|
# Move the track file. Check that we're not importing a
|
||||||
# file that's already in its final destination.
|
# file that's already in its final destination.
|
||||||
if (
|
if os.path.exists(tf.track_path) and tf.track_path != tf.source_file_path:
|
||||||
os.path.exists(tf.track_path)
|
|
||||||
and os.path.exists(tf.source_file_path)
|
|
||||||
and tf.track_path != tf.source_file_path
|
|
||||||
):
|
|
||||||
os.unlink(tf.track_path)
|
os.unlink(tf.track_path)
|
||||||
shutil.move(tf.source_file_path, tf.track_path)
|
shutil.move(tf.source_file_path, tf.track_path)
|
||||||
|
|
||||||
# Import track
|
# Import track
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user