diff --git a/app/musicmuster.py b/app/musicmuster.py index 090c989..c08b00a 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -184,15 +184,16 @@ class ImportTrack(QObject): 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 # file that's already in its final destination. - if ( - os.path.exists(tf.track_path) - and os.path.exists(tf.source_file_path) - and tf.track_path != tf.source_file_path - ): + if os.path.exists(tf.track_path) and tf.track_path != tf.source_file_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 try: