SUMMARY A file containing a space at the end of its name and before the last dot and extension leads to errors when importing tags from filename STEPS TO REPRODUCE 1. Open a directory with music files 2. One of those files is named as "filename .ext" rather than "filename.ext" 3. Set the import filter as "%{discnumber}.%{track} %{title}" 4. Import the tags using the Label 2 button. OBSERVED RESULT - The Title field contains the track number and the title - The Artist field contains the parent/parent directory of the files - The Album field contains the parent directory - The Tracknumber field contains the disc number - Other fields are empty, as expected EXPECTED RESULT - The Title field should only contain the title of the track - The Artist and Album fields should be empty SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.22.0 KDE Frameworks Version: 5.82.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION
First, I am not sure if I understand correctly what you mean with "import filter" and "Label 2" button, but I assume that the "import filter" is the "Format: <arrow down>" control and the "Label 2" button the "Tag 2" button at the right side of this control in the main section of the GUI. You have a format of "%{discnumber}.%{track} %{title}" but a file name "filename .ext", which is missing the discnumber and track part. Let's assume that you have a file name "2.01 filename .ext" then you expect the tag frames to be set as Title="filename ", Track Number="1", Disc Number="2". To get this, you have to use a custom regular expressions in the format, e.g. %{discnumber}(\d{1,4}).%{track}(\d{1,4}) %{title}([^-_\./ ](?:[^/]*[^-_/])?) This is a modification of the standard regular expression for your format %{discnumber}(\d{1,4}).%{track}(\d{1,4}) %{title}([^-_\./ ](?:[^/]*[^-_/ ])?) with the difference that it is accepting a space at the end. You have to use custom regular expressions if you do not want the standard behavior.
(In reply to Urs Fleisch from comment #1) > First, I am not sure if I understand correctly what you mean with "import > filter" and "Label 2" button, but I assume that the "import filter" is the > "Format: <arrow down>" control and the "Label 2" button the "Tag 2" button > at the right side of this control in the main section of the GUI. Yes, that's it. > > You have a format of "%{discnumber}.%{track} %{title}" but a file name > "filename .ext", which is missing the discnumber and track part. Let's I meant the discnumber and track informations are part of "filename .ext". > assume that you have a file name "2.01 filename .ext" then you expect the > tag frames to be set as Title="filename ", Track Number="1", Disc > Number="2". To get this, you have to use a custom regular expressions in the > format, e.g. > > %{discnumber}(\d{1,4}).%{track}(\d{1,4}) %{title}([^-_\./ ](?:[^/]*[^-_/])?) > > This is a modification of the standard regular expression for your format > > %{discnumber}(\d{1,4}).%{track}(\d{1,4}) %{title}([^-_\./ ](?:[^/]*[^-_/ ])?) > > with the difference that it is accepting a space at the end. You have to use > custom regular expressions if you do not want the standard behavior. Perhaps the custom regular expression should become standard to avoid getting scrambled tags.
Git commit efaf8e69552edf364e9b4881e7f0c5503e61eb55 by Urs Fleisch. Committed on 03/10/2021 at 18:42. Pushed by ufleisch into branch 'master'. Get tags from file names with spaces before the extension M +5 -0 src/core/tags/taggedfile.cpp https://invent.kde.org/multimedia/kid3/commit/efaf8e69552edf364e9b4881e7f0c5503e61eb55