|
|
|
@@ -47,10 +47,10 @@ if [ "${1:-}" = "--decorate" ]; then
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "${1:-}" = "--reload" ]; then
|
|
|
|
|
[ ! "${MUSICDIR:-}" ] && err "The environment variable MUSICDIR is not set." && exit 1
|
|
|
|
|
[ ! -d "${MUSICDIR:-}" ] && err "The environment variable MUSICDIR does not point to a directory." && exit 1
|
|
|
|
|
info "Reloading information of local music directory $MUSICDIR"
|
|
|
|
|
load_local || err "Failed to load local data"
|
|
|
|
|
[ ! "${2:-}" ] && err "Path to decorated music is missing." && exit 1
|
|
|
|
|
[ ! -d "$2" ] && err "Path does not point to a directory." && exit 1
|
|
|
|
|
info "Reloading information of local music directory $2"
|
|
|
|
|
load_local "$2" || err "Failed to load local data"
|
|
|
|
|
info "Done"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
@@ -96,9 +96,9 @@ if [ "${1:-}" = "--play-release" ]; then
|
|
|
|
|
sort_by([.pos, .number]) |
|
|
|
|
|
map($base + "/" + .file)[]' >"$tmplist"
|
|
|
|
|
if [ "${4:-}" ]; then
|
|
|
|
|
mpv_play_list "$tmplist"
|
|
|
|
|
else
|
|
|
|
|
mpv_queue_list "$tmplist"
|
|
|
|
|
else
|
|
|
|
|
mpv_play_list "$tmplist"
|
|
|
|
|
fi
|
|
|
|
|
rm -f "$tmplist"
|
|
|
|
|
exit 0
|
|
|
|
@@ -106,11 +106,10 @@ fi
|
|
|
|
|
|
|
|
|
|
if [ "${1:-}" = "--play-recording" ]; then
|
|
|
|
|
echo "Playing recording $2" >>/tmp/foo
|
|
|
|
|
mpv_play_file "$2"
|
|
|
|
|
if [ "${3:-}" ]; then
|
|
|
|
|
mpv_play_file "$2"
|
|
|
|
|
else
|
|
|
|
|
mpv_queue_file "$2"
|
|
|
|
|
else
|
|
|
|
|
mpv_play_file "$2"
|
|
|
|
|
fi
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
@@ -386,7 +385,7 @@ GENERAL OPTIONS:
|
|
|
|
|
|
|
|
|
|
MANAGE LOCAL MUSIC:
|
|
|
|
|
--decorate <path> Decorate directory containing a tagged release
|
|
|
|
|
--reload Populate database with decorated local music
|
|
|
|
|
--reload <path> Populate database with decorated local music from <path>
|
|
|
|
|
EOF
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
@@ -479,14 +478,14 @@ while true; do
|
|
|
|
|
--bind="load:transform:[ \"\$FZF_TOTAL_COUNT\" -gt 0 ] && echo \"rebind:ctrl-l\" || echo \"unbind:ctrl-l\"" \
|
|
|
|
|
--bind="enter:execute-silent:$0 --play-release {2} {3}" \
|
|
|
|
|
--bind="alt-enter:execute-silent:$0 --play-release {2} {3} q" \
|
|
|
|
|
--bind="space:execute-silent:$0 --play-toggle" \
|
|
|
|
|
--bind="alt-space:execute-silent:$0 --play-toggle" \
|
|
|
|
|
--bind="ctrl-n:execute-silent:$0 --play-next" \
|
|
|
|
|
--bind="ctrl-p:execute-silent:$0 --play-previous" \
|
|
|
|
|
--bind="shift-right:execute-silent:$0 --seek-forward" \
|
|
|
|
|
--bind="shift-left:execute-silent:$0 --seek-backward" \
|
|
|
|
|
--bind="focus:transform:
|
|
|
|
|
[ {3} ] && c=rebind || c=unbind
|
|
|
|
|
for key in enter alt-enter space ctrl-n ctrl-p shift-right shift-left; do
|
|
|
|
|
for key in enter alt-enter alt-space ctrl-n ctrl-p shift-right shift-left; do
|
|
|
|
|
printf \"+%s(%s)\" \"\$c\" \"\$key\"
|
|
|
|
|
done
|
|
|
|
|
" \
|
|
|
|
@@ -522,14 +521,14 @@ while true; do
|
|
|
|
|
--bind="alt-l:change-query($FORMAT_LOCAL )" \
|
|
|
|
|
--bind="enter:execute-silent:$0 --play-recording {3}" \
|
|
|
|
|
--bind="alt-enter:execute-silent:$0 --play-recording {3} q" \
|
|
|
|
|
--bind="space:execute-silent:$0 --play-toggle" \
|
|
|
|
|
--bind="alt-space:execute-silent:$0 --play-toggle" \
|
|
|
|
|
--bind="ctrl-n:execute-silent:$0 --play-next" \
|
|
|
|
|
--bind="ctrl-p:execute-silent:$0 --play-previous" \
|
|
|
|
|
--bind="shift-right:execute-silent:$0 --seek-forward" \
|
|
|
|
|
--bind="shift-left:execute-silent:$0 --seek-backward" \
|
|
|
|
|
--bind="focus:transform:
|
|
|
|
|
[ {3} ] && c=rebind || c=unbind
|
|
|
|
|
for key in enter alt-enter space ctrl-n ctrl-p shift-right shift-left; do
|
|
|
|
|
for key in enter alt-enter alt-space ctrl-n ctrl-p shift-right shift-left; do
|
|
|
|
|
printf \"+%s(%s)\" \"\$c\" \"\$key\"
|
|
|
|
|
done
|
|
|
|
|
" \
|
|
|
|
@@ -542,6 +541,11 @@ while true; do
|
|
|
|
|
[ "$lns" -eq 2 ] && [ "$key" = "ctrl-h" ] && set -- "--releasegroup" "$(mb_release "$2" | $JQ -r -c '."release-group".id')"
|
|
|
|
|
[ "$lns" -eq 2 ] && [ "$key" = "ctrl-a" ] && set -- "--select-artist" "$(mb_release "$2" | $JQ -r -c ".media[].tracks[] | select(.id==\"$mid\") | .\"artist-credit\"")"
|
|
|
|
|
;;
|
|
|
|
|
"--playlist")
|
|
|
|
|
count=$(mpv_playlist_count)
|
|
|
|
|
echo "Playlist: count=$count" >>/tmp/foo
|
|
|
|
|
set -- ""
|
|
|
|
|
;;
|
|
|
|
|
"--select-artist")
|
|
|
|
|
tput rmcup
|
|
|
|
|
sel=$(
|
|
|
|
@@ -670,14 +674,14 @@ while true; do
|
|
|
|
|
--bind="load:transform:[ \"\$FZF_TOTAL_COUNT\" -gt 0 ] && echo \"rebind:ctrl-l\" || echo \"unbind:ctrl-l\"" \
|
|
|
|
|
--bind="enter:execute-silent:$0 --play-release {2} {3}" \
|
|
|
|
|
--bind="alt-enter:execute-silent:$0 --play-release {2} {3} q" \
|
|
|
|
|
--bind="space:execute-silent:$0 --play-toggle" \
|
|
|
|
|
--bind="alt-space:execute-silent:$0 --play-toggle" \
|
|
|
|
|
--bind="ctrl-n:execute-silent:$0 --play-next" \
|
|
|
|
|
--bind="ctrl-p:execute-silent:$0 --play-previous" \
|
|
|
|
|
--bind="shift-right:execute-silent:$0 --seek-forward" \
|
|
|
|
|
--bind="shift-left:execute-silent:$0 --seek-backward" \
|
|
|
|
|
--bind="focus:transform:
|
|
|
|
|
[ {3} ] && c=rebind || c=unbind
|
|
|
|
|
for key in enter alt-enter space ctrl-n ctrl-p shift-right shift-left; do
|
|
|
|
|
for key in enter alt-enter alt-space ctrl-n ctrl-p shift-right shift-left; do
|
|
|
|
|
printf \"+%s(%s)\" \"\$c\" \"\$key\"
|
|
|
|
|
done
|
|
|
|
|
" \
|
|
|
|
|