## Discord Plex FR : https://discord.gg/3gtABCH
## Version 2021-08-26
##
## Pour une aide à l'installation, consulter le README
##
#!/bin/bash

while read FILE ; do
    [[ -e ${FILE%%.*}.mp3 ]] || ffmpeg -i "$FILE" -ab 320k -map_metadata 0 "${FILE%.*}.mp3"
    [[ $? -eq 0 ]] && rm $FILE
done < <(find . -name "*.flac")