I doubt you'll find an out of the box solution for this. When you start wanting custom automation, you have to be able to program/write scripts. calibre has a command lien tool calibredb to aid with the latter
https://manual.calibre-ebook.com/gen...calibredb.html