-
I have a playlist with tracks, for each day of the year a specific track. How can I integrate this in Azuracast? My own ideas:
When I create a playlist with daily.mp3 and overwrite this file, it is also removed from the playlist. How can I fix this? Can I use a playlist from a remote URL that points to the daily.mp3 file? Like /var/azuracast/stations/my_radio_channel/media/Test/daily.mp3 Hope others have a suggestion as well. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi!
services:
web:
volumes:
- /var/azuracast/daily:/var/azuracast/stations/***YOUR-STATION***/media/daily
# We reload the playlist manually to be sure it holds the newest generated file.
# It's nice to generate file at 9:00, reload playlist at 10:00 and play track a 11:00 for example to have some space between.
thread.when(predicate.activates({ 10h00m }), fun() -> playlist_dailytracks.reload()) Then do whatever you want. If it is an announcement of some sort and you wanna play it at 11:00 sharp - you can radio = smooth_add(duration=2., p=.3, normal=radio, special=switch([(predicate.once({ 11h00m }), playlist_dailytracks)])) Alternatively you can use radio = fallback(track_sensitive=false,[
switch([(predicate.once({11h00m}), playlist_dailytracks)]),
radio
]) |
Beta Was this translation helpful? Give feedback.
-
Hi @gAlleb, I have tested it and it works perfectly. Here's my bash script to copy the files, I run this as a daily cron job around midnight: #!/bin/bash
# Get the day of the year (1-366)
DAY_OF_YEAR=$(date +%j)
# Define the source directory
SOURCE_DIR="/var/azuracast/YearFiles"
# Define the destination file
DEST_FILE="/var/azuracast/daily/daily.mp3"
# Find the file that matches the pattern
SOURCE_FILE=$(find "$SOURCE_DIR" -name "day-${DAY_OF_YEAR}-*.mp3" -print -quit)
# Check if the file exists
if [ -n "$SOURCE_FILE" ]; then
# Copy the file to the destination
sudo cp "$SOURCE_FILE" "$DEST_FILE"
else
echo "File for day ${DAY_OF_YEAR} not found: dag-${DAY_OF_YEAR}-*.mp3" | sudo tee -a /var/azuracast/copy_daily_mp3.log
fi |
Beta Was this translation helpful? Give feedback.
Hi!
mkdir /var/azuracast/daily
cp daily.mp3 /var/azuracast/daily/
in the end.docker-compose.override.yml
->nano /var/azuracast/docker-compose.override.yml
and mount a folder into azuracast: