FWIW: I use the GetFileName optional plugin, I have it configured to put the path of the file that creates a book into a custom column (#camefrom/Came From), see ==>>
Index of plugins
I have a few saved bulk S&R regexes to do some wrangling of the file path into other columns
Its a File Type plugin -- towards the end of the list.
Not sure if the PI gets invoked via calibredb add command.
BR