fixes and history (1 level)

from VIEW_PLAYLIST and VIEW_SELECT_ARTIST we can now go "back"
This commit is contained in:
2025-09-07 14:08:54 +02:00
parent dfcae7cf89
commit 70da0ed282
3 changed files with 36 additions and 129 deletions

View File

@@ -79,93 +79,6 @@ __set_prompt() {
printf "+change-header(%s %s)" "$PT" "${PROMPT:-"$SEARCH_PROMPT"}"
}
# Reload data for FZF
fzf_handle_reload() {
view=$(state_get_view)
mode=$(state_get_mode)
args=$(state_get_args)
case "$view" in
"$VIEW_ARTIST")
list_releasegroups "$args"
;;
"$VIEW_RELEASEGROUP")
list_releases "$args"
;;
"$VIEW_RELEASE")
list_recordings "$args"
;;
"$VIEW_LIST_ARTISTS")
list_local_artists
;;
"$VIEW_LIST_ALBUMS")
list_local_releasegroups
;;
esac
}
# Handle for after loading data into FZF
fzf_handle_load() {
view=$(state_get_view)
mode=$(state_get_mode)
args=$(state_get_args)
case "$view" in
"$VIEW_ARTIST")
QUERY="!'$QUERY_HAS_SECONDARY' "
;;
"$VIEW_RELEASEGROUP")
[ "$QUERY_RV" ] && QUERY="'$QUERY_RV' " || QUERY=""
;;
"$VIEW_SEARCH_ARTIST")
ENABLE_CHANGE=1
DISABLE_SEARCH=1
SHOW_PREVIEW=1
;;
"$VIEW_SEARCH_ALBUM")
ENABLE_CHANGE=1
DISABLE_SEARCH=1
;;
"$VIEW_LIST_ARTISTS")
SHOW_PREVIEW=1
;;
"$VIEW_LIST_ALBUMS") ;;
esac
[ "${DISABLE_SEARCH:-}" ] && printf "+disable-search+change-query(%s)+disable-search" "${QUERY:-"$FZF_QUERY"}" || printf "+enable-search+change-query(%s)+enable-search" "${QUERY:-}"
[ "${SHOW_PREVIEW:-}" ] && printf "+show-preview" || printf "+hide-preview"
[ "${ENABLE_CHANGE:-}" ] && printf "+rebind(change)" || printf "+unbind(change)"
__set_prompt "$view" "$mode"
}
# Print info string for FZF
fzf_info() {
view=$(state_get_view)
mode=$(state_get_mode)
args=$(state_get_args)
case "$view" in
"$VIEW_SEARCH_ARTIST")
echo "Search music artist on MusicBrainz"
;;
"$VIEW_SEARCH_ALBUM")
echo "Search album on MusicBrainz"
;;
"$VIEW_LIST_ARTISTS")
echo "Search artists"
;;
"$VIEW_LIST_ALBUMS")
echo "Search albums"
;;
"$VIEW_SELECT_ARTIST")
debug "Select artist (WE SHOULDNT SEE THIS; THIS IS A BUG!)"
;;
*)
if [ "$FZF_KEY" ]; then
printf "[last key: %s] %s/%s" "$FZF_KEY" "$FZF_MATCH_COUNT" "$FZF_TOTAL_COUNT"
else
printf "%s/%s" "$FZF_MATCH_COUNT" "$FZF_TOTAL_COUNT"
fi
;;
esac
}
# Reload hook that is used after change in query
fzf_reload_after_change() {
# Wait for async. process to terminate

View File

@@ -123,7 +123,7 @@ KEYS_FILTER="$KEYS_FILTER_LOCAL,$KEYS_FILTER_1,$KEYS_FILTER_2,$KEYS_FILTER_3,$KE
KEYS_BROWSE="${KEYS_BROWSE:-"alt-b"}"
KEYS_OPEN="${KEYS_OPEN:-"alt-o"}"
KEYS_SHOW_PLAYLIST="${KEYS_SHOW_PLAYLIST:-"ctrl-p"}"
KEYS_QUIT="${KEYS_QUIT:-"ctrl-c"}"
KEYS_QUIT="${KEYS_QUIT:-"ctrl-c,esc"}"
KEYS_N_QUIT="${KEYS_N_QUIT:-"q"}"
# Playback:
@@ -157,7 +157,6 @@ KEYS_PLAYLIST_CLEAR_BELOW="${KEYS_PLAYLIST_CLEAR_BELOW:-"D"}"
KEYS_PLAYLIST_GOTO_RELEASE="${KEYS_PLAYLIST_GOTO_RELEASE:-"ctrl-g"}"
KEYS_PLAYLIST_STORE="${KEYS_PLAYLIST_STORE:-"ctrl-s"}"
KEYS_PLAYLIST_LOAD="${KEYS_PLAYLIST_LOAD:-"ctrl-o"}"
KEYS_PLAYLIST_QUIT="${KEYS_PLAYLIST_QUIT:-"q,ctrl-c,esc"}"
## Not yet characterized
##########################