ptgdp: Add sanity check for MPD

This commit is contained in:
Salt 2019-08-13 03:39:19 -05:00
parent e5bf4e6f50
commit ac2043ecb6

6
ptgdp
View File

@ -144,6 +144,12 @@ playlist() {
log "Music can be found at \"$_musicdir\""
fi
fi
if [ -z "$_optdownloadonly" ] && ! mpc status > /dev/null 2>&1; then
notify "Could not communicate with MPD" \
"MPD connection was refused. Ensure your configuration is correct and the daemon is currently running." \
normal dialog-error 3000
error "Failed to communicate with MPD" 52
fi
local -i dlexist=0
local -i dlsuccess=0
local -i dlfailure=0