diff --git a/src/main.sh b/src/main.sh index 4133f07..cff7656 100755 --- a/src/main.sh +++ b/src/main.sh @@ -66,6 +66,11 @@ if [ "${MUSICDIR:-}" ]; then list_artists exit 0 fi + + if [ "${1:-}" = "--play-release" ]; then + echo "Playing release $2" >>/tmp/foo + exit 0 + fi fi if [ "${1:-}" = "--internal-preview-artist" ]; then @@ -246,7 +251,7 @@ if [ "${1:-}" = "--internal-list-releases" ]; then sort -n -r | cut -d "$(printf '\t')" -f 2- | column -t -s "$(printf '\t')" | - sed 's| \+\([0-9a-f-]\+\) \+\([^ ].*$\)$|\t\1\t\2|' + sed 's| \+\([0-9a-f-]\+\) *\(.*$\)$|\t\1\t\2|' exit 0 fi @@ -370,7 +375,7 @@ if [ "${1:-}" = "--internal-list-local-releases" ]; then sort -n -r | cut -d "$(printf '\t')" -f 2- | column -t -s "$(printf '\t')" | - sed 's| \+\([0-9a-f-]\+\) \+\([^ ].*$\)$|\t\1\t\2|' + sed 's| \+\([0-9a-f-]\+\) *\(.*$\)$|\t\1\t\2|' exit 0 fi @@ -449,7 +454,7 @@ while true; do --with-nth="{1}" \ --expect="ctrl-h,ctrl-a" \ --bind="load:transform:[ \"\$FZF_TOTAL_COUNT\" -gt 0 ] && echo \"rebind:ctrl-l\" || echo \"unbind:ctrl-l\"" \ - --bind="enter:transform:echo \"play {}\" >> /tmp/foo" \ + --bind="enter:execute-silent:$0 --play-release {3}" \ --bind="focus:transform:[ {3} ] && echo \"rebind:enter\" || echo \"unbind:enter\"" \ --bind="ctrl-l:accept" \ --bind="alt-b:execute-silent:xdg-open 'https://musicbrainz.org/release/{r2}' &" \