cuetools.net icon indicating copy to clipboard operation
cuetools.net copied to clipboard

File path generation giving a space chr at end of "artist"\

Open janhal opened this issue 2 years ago • 3 comments

On one cd the artist part of file path is padded with a ' ' in front of following ''. Raises an exception later. 2023-05-28

janhal avatar May 28 '23 14:05 janhal

This appears to be an issue with the data stored in the database (CTDB). You should report to the database project https://github.com/gchudov/db.cue.tools/issues The data was likely retrieved and duplicated from the old freedb while hosted by Magix (shut down March 31 2020). You can see the space is included in the artist field in the CTDB database lYcNIiQQFNG6QWvSH1UwW_tWhWw-

ha-korth avatar May 28 '23 20:05 ha-korth

Suggest to trim each path-part before concatenating:-)

janhal avatar May 29 '23 04:05 janhal

Thanks for reporting the issue, when artist contains a trailing space. The following exception occurs: System.IO.DirectoryNotFoundException: Could not find a part of the path ...

This exception currently occurs here: https://github.com/gchudov/cuetools.net/blob/29d46d273388d134d4c379fa568bbc04179e2f7c/CUETools.Processor/CUESheet.cs#L2744

Background: A directory name that has trailing spaces cannot be created without using \\?\ at the beginning of the path. Using such a UNC path in the output path would work around the exception, e.g.: \\?\%music%\%artist%\[%year% - ]%album%\%artist% - %album%.cue

However, it is probably better to avoid trailing spaces in the artist or other fields.

c72578 avatar Jun 13 '23 17:06 c72578