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