Rather than inotifwait it might be simpler to install entware and the monit package on your Synology and use it to monitor for changes to metadata.db and issue the curl command on change.
See
https://www.mmonit.com for the monit command.
Sent from my Pixel 7a using Tapatalk