bugfix and keys

bugfix: playing failed with tracks of unknown length
keys: added yank keys
This commit is contained in:
2025-09-11 13:59:27 +02:00
parent 56b8c73297
commit 3702bc54a8
4 changed files with 12 additions and 2 deletions

View File

@@ -48,6 +48,8 @@
# Specials:
# - KEYS_BROWSE: Open MusicBrainz webpage of the selected item
# - KEYS_OPEN: Open file manager in the directory of the selected item
# - KEYS_N_YANK: Copy MusicBrainz ID of selected item to clipboard
# - KEYS_YANK_CURRENT: Copy MusicBrainz ID of current item to clipboard
# - KEYS_SHOW_PLAYLIST: Switch to playlist view
# - KEYS_QUIT: Quit application
# - KEYS_N_QUIT: Quit application if we are in VIEW_LIST_ARTISTS, else go to
@@ -133,10 +135,13 @@ export KEYS_FILTER_LOCAL KEYS_FILTER_1 KEYS_FILTER_2 KEYS_FILTER_3 \
# Specials:
KEYS_BROWSE="${KEYS_BROWSE:-"alt-b"}"
KEYS_OPEN="${KEYS_OPEN:-"alt-o"}"
KEYS_N_YANK="${KEYS_N_YANK:-"y"}"
KEYS_YANK_CURRENT="${KEYS_YANK_CURRENT:-"ctrl-y"}"
KEYS_SHOW_PLAYLIST="${KEYS_SHOW_PLAYLIST:-"ctrl-p"}"
KEYS_QUIT="${KEYS_QUIT:-"ctrl-c"}"
KEYS_N_QUIT="${KEYS_N_QUIT:-"q"}"
export KEYS_BROWSE KEYS_OPEN KEYS_SHOW_PLAYLIST KEYS_QUIT KEYS_N_QUIT
export KEYS_BROWSE KEYS_OPEN KEYS_N_YANK KEYS_YANK_CURRENT KEYS_SHOW_PLAYLIST \
KEYS_QUIT KEYS_N_QUIT
# Playback:
KEYS_PLAY="${KEYS_PLAY:-"enter"}"

View File

@@ -73,7 +73,7 @@ __generate_playlist() {
(."artist-credit" | map([.name, .joinphrase] | join("")) | join("")),
$deco
] | join("\t"),
length: (.length / 1000 | round | tostring),
length: (.length // 0 / 1000 | round | tostring),
$pos,
number: .number,
file: $filenames[.id]

View File

@@ -39,5 +39,8 @@ if [ ! "${TOOLS_LOADED:-}" ]; then
fi
export SOCAT
command -v "xsel" >/dev/null && CLIP="xsel" || CLIP="true"
export CLIP
export TOOLS_LOADED=1
fi