diff --git a/spotrec.py b/spotrec.py index 91f7ce1..3cb4c82 100755 --- a/spotrec.py +++ b/spotrec.py @@ -337,8 +337,9 @@ def run(self): # Create output folder if necessary # If filename_pattern specifies subfolder(s) the track name is only the basename while the dirname is the subfolder path + # Note, the basename()-call on the track name ensures stripping of leading slashes in case these were reported self.out_dir = os.path.join( - _output_directory, os.path.dirname(self.parent.track)) + _output_directory, os.path.basename(os.path.dirname(self.parent.track))) Path(self.out_dir).mkdir( parents=True, exist_ok=True)