summaryrefslogtreecommitdiff
path: root/templates/icecast2
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-07-05 13:47:40 +0300
committerheqnx <root@heqnx.com>2025-07-05 13:47:40 +0300
commit7ff2aaef6717b97278d97e40143e0dec22924fa5 (patch)
tree2124d5358bdb58caf9147f2a022e2dc65c8ae458 /templates/icecast2
parente95318bcada0feb1dcdd44773e690b2addc6de38 (diff)
downloadansible-icecast2-7ff2aaef6717b97278d97e40143e0dec22924fa5.tar.gz
ansible-icecast2-7ff2aaef6717b97278d97e40143e0dec22924fa5.zip
improvements, added metadata to script convertor, added spinnet, added track info to html
Diffstat (limited to 'templates/icecast2')
-rw-r--r--templates/icecast2/mp3-to-ogg.sh.j212
1 files changed, 8 insertions, 4 deletions
diff --git a/templates/icecast2/mp3-to-ogg.sh.j2 b/templates/icecast2/mp3-to-ogg.sh.j2
index b37f5af..f475d36 100644
--- a/templates/icecast2/mp3-to-ogg.sh.j2
+++ b/templates/icecast2/mp3-to-ogg.sh.j2
@@ -10,10 +10,9 @@ DIR="{{ radio_music_dir }}"
shopt -s nullglob
for mp3file in "${DIR}"/*.mp3; do
oggfile="${mp3file%.mp3}.ogg"
+ printf "%s\n" "[inf] converting ${mp3file} to ${oggfile} with ${title}"
- printf "%s\n" "[inf] converting ${mp3file} to ${oggfile}"
-
- if ffmpeg -loglevel error -y -i "${mp3file}" -acodec libvorbis -q:a 5 "${oggfile}"; then
+ if ffmpeg -loglevel error -y -i "${mp3file}" -acodec libvorbis -q:a 5 -metadata title="${title}" "${oggfile}"; then
printf "%s\n" "[inf] conversion successful, removing ${mp3file}"
rm -f "${mp3file}"
else
@@ -21,7 +20,13 @@ for mp3file in "${DIR}"/*.mp3; do
fi
done
+for oggfile in "${DIR}"/*.ogg; do
+ title="$(basename "${oggfile}" .ogg)"
+ vorbiscomment -w -t "TITLE=${title}" "${oggfile}"
+done
+
ls "${DIR}"/*.ogg > "${DIR}/playlist.txt"
+printf "%s\n" "[inf] playlist generated at ${DIR}/playlist.txt"
if id -u icecast2 >/dev/null 2>&1 && getent group icecast >/dev/null 2>&1; then
chown -R icecast2:icecast "$DIR"
@@ -29,4 +34,3 @@ if id -u icecast2 >/dev/null 2>&1 && getent group icecast >/dev/null 2>&1; then
else
printf "%s\n" "[err] user or group icecast2:icecast does not exist, skipping chown"
fi
-