# note: PijokVipiotOzeph is just a random string for a delimiter
# shellcheck disable=SC2016 # false positive
- fmt='%ifdef{rating,$rating }'"$tag_query"'$genres | $title - $artist - $album $length $id PijokVipiotOzeph $path'
+ fmt='%ifdef{rating,$rating }'"$tag_query"'$genres | $title - $artist - $album $length $id PijokVipiotOzeph /i/m/$path'
for tag in "${pl_tags[@]}"; do
local -A paths
tmpf="$(mktemp)"
# shellcheck disable=SC2016 # obvious reason
- beet ls -f '$path' $nav_convert_query >"$tmpf"
+ beet ls -f '/i/converted/$path' $nav_convert_query >"$tmpf"
## begin removal of files that are leftover from previous conversion,
# eg, previously rated > 1, now rated 1.
while read -r l; do
- convertedpath="/i/converted${l#/i/m}"
- if [[ $convertedpath == *.flac ]]; then
- convertedpath="${convertedpath%.flac}.mp3"
+ if [[ $l == *.flac ]]; then
+ l="${l%.flac}.mp3"
fi
- paths[$convertedpath]=t
+ paths[$l]=t
done <"$tmpf"
find /i/converted -path /i/converted/beetsmartplaylists -prune -o \( -type f -print \) -name '*.mp3' -o -name '*.m4a' >"$tmpf"
rm -rf /i/converted/beetsmartplaylists
mkdir -p /i/converted/beetsmartplaylists
for f in /tmp/ianbeetstmp/*; do
- sed 's,^/i/m,/i/converted,;s,\.flac$,.mp3,' "$f" >"/i/converted/beetsmartplaylists/${f##*/}"
+ sed 's,^,/i/converted,;s,\.flac$,.mp3,' "$f" >"/i/converted/beetsmartplaylists/${f##*/}"
rm "$f"
done
rmdir /tmp/ianbeetstmp
ssh_prefix="ssh b8.nz"
fi
# shellcheck disable=SC2016 # obvious reason
- beet ls -f '$rating $path' $nav_convert_query | $ssh_prefix beetrating-stdin
+ beet ls -f '$rating /i/converted/$path' $nav_convert_query | $ssh_prefix beetrating-stdin
}
# internal function for beetrating, in case we need to ssh
beetrating-stdin() {
- local tmp rating path cpath sqlpath userid
+ local tmp rating cpath sqlpath userid
# plucked this from the db. im the only user.
userid=23cc2eb9-e35e-4811-a0f0-d5f0dd6eb634
- while read -r rating path; do
- cpath="/i/converted${path#/i/m}" # converted path
+ while read -r rating cpath; do
if [[ $cpath == *.flac ]]; then
cpath="${cpath%.*}.mp3"
fi