tone is a cross platform audio tagger and metadata editor to dump and modify metadata for a wide variety of formats, including mp3, m4b, flac and more. It has no dependencies and can be downloaded as single binary for Windows, macOS, Linux and other common platforms.
I would like to have a watch command to watch a directory for filesystem changes and run shell commands, so that it is possible to watch a directory with audio books and start a conversion tool, as soon as new files are put in.
Important Note:
Maybe this exceeds the scope of tone as an audio tagger and has to be extracted in an extra tool (like fswatch, fswatcher, fsmon or baywatch - last name is to prevent name conflicts with existing more popular tools like https://github.com/emcrisostomo/fswatch)
Tasks:
[ ] implement watch command with a --directory parameter to specify the directory
[ ] add --debounce-milliseconds=<timespan> parameter to prevent running immediately on a change (e.g. when still copying files) to prevent too early execution
[ ] add --event-type parameter (multiple usage) to watch for specific events (changed, renamed, created, deleted)
Optional tasks / ideas:
[ ] implement --ignore-errors parameter for e.g. directory is not existing (retry to register the filesystem watcher
[ ] implement --retry-on-error-milliseconds for --ignore-errors
Example:
tone watch --directory="/tmp/dir/" --debounce-milliseconds="300000" ls /tmp/dir
I would like to have a
watch
command to watch a directory for filesystem changes and run shell commands, so that it is possible towatch
a directory with audio books and start a conversion tool, as soon as new files are put in.Important Note: Maybe this exceeds the scope of
tone
as an audio tagger and has to be extracted in an extra tool (likefswatch
,fswatcher
,fsmon
orbaywatch
- last name is to prevent name conflicts with existing more popular tools like https://github.com/emcrisostomo/fswatch)Tasks:
watch
command with a--directory
parameter to specify the directory--debounce-milliseconds=<timespan>
parameter to prevent running immediately on a change (e.g. when still copying files) to prevent too early execution--event-type
parameter (multiple usage) to watch for specific events (changed
,renamed
,created
,deleted
)Optional tasks / ideas:
--ignore-errors
parameter for e.g. directory is not existing (retry to register the filesystem watcher--retry-on-error-milliseconds
for--ignore-errors
Example: