linuxbashstreamingubuntu-18.04liquidsoap

Liquidsoap: how to remove track from playlist?


I have a goal to stream new files from a directory with Liquidsoap.
1. Inotify tracks target folder and adds all new files to playlist:

#!/bin/bash
inotifywait -e close_write --format '%f' -m "/my/folder" | \
(
while read NEWFILE
do
echo $NEWFILE >> playlist.txt
done
)

2. Liquidsoap plays playlist.txt

#!/usr/bin/liquidsoap
radio = mksafe(playlist(loop=false,mode='normal',reload=0,reload_mode="watch", "playlist.txt"))

3. last step: Liquidsoap should remove track from playlist.txt after it have been played
Need help with removing!


Solution

  • To remove some track after it has been played just add prefix="tmp:"

    radio = mksafe(playlist(prefix="tmp:",loop=false,mode='normal',reload=0,reload_mode="watch", "playlist.txt"))