Kid3-cli and timestamp preservation

Dear All,

I’m an absolute enthusiast using kid3 for updating and streamlining the tags of my music collection.

I am fairly new to using kid3-cli for routine stuff. The following example selects all mp3s in a folder, copies Tag 2 to Tag 1, assigns the tags to the filenames and finally applies the wanted filename format corrections:

kid3-cli -c "select *.mp3" -c "syncto 1" -c "fromtag '%{track} - %{title} - %{artist}' 2" -c "filenameformat" -c "save"

So far, so perfect.

The only thing that strikes me as strange is the fact that the timestamp of the files is not kept, as it does when using kid3 in GUI mode. I’ve checked that the option is set in the GUI and that it is also reflected in the kid3rc config file:

PreserveTime=true

Shouldn’t the “save” command in kid3-cli stick to that option too?

Thanx’n regardz
tuxEvangelist

1 Like

You were close to the solution. The problem is that kid3-cli has no KDE dependencies and thus shares its configuration with kid3-qt and not with kid3. So instead of modifying kid3rc, you will have to modify ~/.config/Kid3/Kid3.conf, the option PreserveTime=true in the section [Files]. But you can also do without hacking configuration files since kid3-cli has a command to get and set configuration options, you can just use kid3-cli -c "config File.preserveTime true".

By the way: If you use kid3-cli non-interactively, it will automatically save modifications and you can pass files as an argument, so your example could be simplified to

kid3-cli -c "syncto 1" -c "fromtag '%{track} - %{title} - %{artist}' 2" -c "filenameformat" *.mp3
1 Like

Ah well, I was not aware of that. I even stumbled across a package kid3-qt that I haven’t installed so far.

But even using

kid3-cli -c "config File.preserveTime true"

created the * ~/.config/Kid3/Kid3.conf* file right away. One more thing learned today, thanks a ton :wink:

And also thank you for the hint on the shorter -c command, it’s always better to have it tightened up for later maintenance…