From 7afe0d8f34bd2c9c4e1004acb75263b518ee8624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=84min=20Baumeler?= Date: Mon, 15 Sep 2025 14:06:09 +0200 Subject: [PATCH] tool update --- src/main.sh | 1 + src/sh/local.sh | 2 +- src/sh/tools.sh | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.sh b/src/main.sh index dc2e230..44f3416 100755 --- a/src/main.sh +++ b/src/main.sh @@ -373,6 +373,7 @@ case "${1:-}" in # This method reads the tags of the audio files in the specified directory. # If the audio files contain MusicBrainz tags, and they are consistent, then # a decoration file is written to that directory. + [ ! "$FFPROBE" ] && err "This option requires ffprobe. Quitting the application now." && exit 1 [ ! "${2:-}" ] && err "You did not specify a directory." && exit 1 [ ! -d "$2" ] && err "Path $2 does not point to a directory." && exit 1 if ! decorate "$2"; then diff --git a/src/sh/local.sh b/src/sh/local.sh index 0039e11..b9ee4a6 100644 --- a/src/sh/local.sh +++ b/src/sh/local.sh @@ -31,7 +31,7 @@ fi # The tags retrieved are the MusicBrainz release ID and the MusicBrainz track # ID __gettags() { - ffprobe -v error -show_entries format_tags -print_format json "$1" | + $FFPROBE -v error -show_entries format_tags -print_format json "$1" | $JQ '.format.tags | { trackid: (."MusicBrainz Release Track Id" // ."MUSICBRAINZ_RELEASETRACKID" // ."MusicBrainz/Release Track Id" // ""), releaseid: (."MusicBrainz Album Id" // ."MUSICBRAINZ_ALBUMID" // ."MusicBrainz/Album Id" // "") diff --git a/src/sh/tools.sh b/src/sh/tools.sh index 19255eb..9cca575 100644 --- a/src/sh/tools.sh +++ b/src/sh/tools.sh @@ -49,6 +49,9 @@ if [ ! "${TOOLS_LOADED:-}" ]; then fi export SOCAT + command -v "ffprobe" >/dev/null && FFPROBE="ffprobe" || FFPROBE="" + export FFPROBE + command -v "xsel" >/dev/null && CLIP="xsel" || CLIP="true" export CLIP