- done
-done
-# The ones we didnt find and remove are ones we added
-# in navidrome.
-for id in ${!navlists[@]}; do
- [[ ${navlists[id]} ]] || continue
- m beet modify -y "id:$id" ${navlists[id]// /=t }=t
-done
-
-# old way of doing it which sets everything. this doesnt
-# account for removed tracks in navidrome, and it will
-# be slower for handling many playlists.
-# while read -r id plists; do
-# plists="${plists#;}"
-# m beet modify -y "id:$id" ${plists//;/=t }
-# done < <(beet ls -f '$id $subsonic_playlist' subsonic_playlist::.)
+ m beet modify -y "path:$path" "$plist!"
+ # files unique to tmpf are in beets not navidrome
+ done < <(comm -23 p $plist)
+ while read -r path; do
+ flac="${path%.mp3}.flac"
+ echo "flac=$flac path=$path ${flacs[$flac]} ${flacs[flac]}"
+ if [[ ${flacs[$flac]} ]]; then
+ path="$flac"
+ fi
+ m beet modify -y "path:$path" $plist=t
+ # files unique to plist are in navidrome not beets
+ done < <(comm -13 p $plist)