diff --git a/lib.sh b/lib.sh index 417e01b..075b92c 100644 --- a/lib.sh +++ b/lib.sh @@ -94,7 +94,7 @@ _play() { echo mpv "$1" || { echo "Not able to play your station." - search_menu + return 1 } } @@ -124,7 +124,7 @@ _wget_simple_search() { KEY="$2" SEARCH_RESULTS="${TMP_PATH}/radio_searches.json" greenprint "Searching ..." - echo "Key: $KEY and reply: $REPLY" + # echo "Key: $KEY and reply: $REPLY" wget --post-data "$KEY=$REPLY" "$SEARCH_URL" -O "$SEARCH_RESULTS" 2>/tmp/tera_error || { redprint "Something went wrong. Please see /tmp/tera_error" exit diff --git a/play.sh b/play.sh index 063c813..abd681c 100644 --- a/play.sh +++ b/play.sh @@ -31,10 +31,18 @@ fn_play() { echo printf "Type a number to play. " read -r ANS + # echo "$ANS" + # get list path + # FAV_FULL=_station_list + # echo "LIST: $LIST" + # echo "$FAVORITE_PATH/$LIST.json" + LIST_PATH="$FAVORITE_PATH/$LIST.json" + # echo "${LIST[$ANS]}" # find the $ANS line e.g. line 2 - URL_RESOLVED=$(jq -r ".[$ANS-1] |.url_resolved" <"${FAVORITE_FULL}") + URL_RESOLVED=$(jq -r ".[$ANS-1] |.url_resolved" <"${LIST_PATH}") + # echo "url_resolved: $URL_RESOLVED" if [[ -n $URL_RESOLVED ]]; then - _play "$URL_RESOLVED" + _play "$URL_RESOLVED" || menu else echo "url_resolved can't be found. Exiting ..." exit 1 diff --git a/tera b/tera index e8b66cd..7acde40 100755 --- a/tera +++ b/tera @@ -3,7 +3,7 @@ set -eu # shellcheck disable=SC2034 -VERSION="0.3.13" +VERSION="0.3.14" SCRIPT_DOT_DIR="$HOME/.config/tera" # CACHE_DIR="$HOME/.cache" FAVORITE_PATH="$SCRIPT_DOT_DIR/favorite"