ptgdp: Properly handle invoking -R with a file

This commit is contained in:
Salt 2019-08-18 01:31:26 -05:00
parent d7b8c7e392
commit a41600823a

11
ptgdp
View File

@ -278,6 +278,8 @@ rofimenu() {
error "Could not open directory \"$_optrofi\"" 2
else
[ -f "$_optrofi" ] || error "Could not open file \"$_optrofi\"" 2
rofiplaysong "$_optrofi"
return $?
fi
fi
files=$(find "$_optrofi" -type f -name \*.gdp)
@ -324,10 +326,13 @@ rofiplaysong() {
choice="$(rofi -dmenu -i -p "$prompt" <<< "$songs" 2>/dev/null)"
if [ -z "$choice" ]; then
# Assume user is looking for another list
# Kick him back to the main menu
rofimenu
# Kick him back to the main menu, unless he picked a file
if ! [ "$_optrofi" = "$1" ]; then
rofimenu
else
error "User aborted at selection" 62
fi
fi
log "User picked: $choice"
queuesong "$choice"
[ "$?" = "1" ] && return 62
execqueue