+shopt -s nullglob
+for path in 2genre/*/*; do
+ id="${path#*/}"
+ id="${id%/*}"
+ filename="${path##*/}"
+ tmp="${filename%%[^0-9-]*}"
+ genre="${filename#"$tmp"}"
+ if [[ ${genre_a[$genre]} ]]; then
+ is_genre=true
+ else
+ # Some playlists we create with random names to remind us to do something
+ # with these tracks later once we are at a computer.
+ is_genre=false
+ fi
+ while read -r path; do
+ flac="${path%.mp3}.flac"
+ if [[ ${flacs[$flac]} ]]; then
+ path="$flac"
+ fi
+ if $is_genre; then
+ m beet modify -y "path:$path" "genre=$genre"
+ else
+ m beet modify -y "path:$path" "$genre=t"
+ fi
+ done <"$path"
+ # how i figured this out:
+ # s tcpdump -i any -w /tmp/tcpdump port 4533
+ # then delete a test playlist in client.
+ # made some sense out of it with: http://www.subsonic.org/pages/api.jsp
+ # open file in wireshard, right click "Hypertext Transfer Protocol", copy, as printable text, put into file /tmp/headers
+ # /a/opt/h2c/h2c </tmp/headers
+ # change from https to http.
+ # then tested out removing stuff i suspected was not important,
+ # and added https and host so it would work remotely.
+ m curl --http1.1 --user "iank:$navidrome_pw" "https://b8.nz/rest/deletePlaylist.view?u=iank&s=sb219dvv7egnoe4i47k75cli0m&t=1c8f5575cd0fdf03deb971187c9c88b1&v=1.2.0&c=DSub&id=$id"
+done