From b0aba545a83ef111503686f93070b463c78e3917 Mon Sep 17 00:00:00 2001 From: tea Date: Sun, 12 May 2024 23:11:16 +0200 Subject: [PATCH] zsh: add tag_audio --- .config/zsh/functions/tag_audio | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .config/zsh/functions/tag_audio diff --git a/.config/zsh/functions/tag_audio b/.config/zsh/functions/tag_audio new file mode 100755 index 0000000..3af679f --- /dev/null +++ b/.config/zsh/functions/tag_audio @@ -0,0 +1,22 @@ +#!/usr/bin/env zsh +# tag album(s) + +setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL + +function _tag_audio_extra_tags() { + bpmdetect --console --save --min 40 --max 220 --limit ${dir}/* + rg-dir ${dir} +} + +for dir in ${@}; do + picard ${dir} + mksmol ${dir} + + if [[ ${dir} == ${@[-1]} ]]; then + _tag_audio_extra_tags + else + _tag_audio_extra_tags & + fi +done + +unfunction _tag_audio_extra_tags