Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: Watch changes in a remote playlist #4020

Open
iSerganov opened this issue Jul 12, 2024 · 3 comments
Open

[Feature request]: Watch changes in a remote playlist #4020

iSerganov opened this issue Jul 12, 2024 · 3 comments

Comments

@iSerganov
Copy link

At the moment reload_mode="watch" is not supported by remote playlists.

And it would be super nice feature to have!

Until it is implemented, the workaround is to put a script like this into your Liquidsoap container:

while [ true ]
do
    if test -e "$PLAYLIST_PATH"
    then zflag="-z $PLAYLIST_PATH"
    else zflag=
    fi
    curl -o /playlist.pls $zflag $PLAYLIST_URL
    sleep $INTERVAL_SECONDS
done

And my .liq file contains playlist definition as follows:

myplaylist = playlist(environment.get("PLAYLIST_PATH"),reload_mode="watch")

My suggestion is to make reload_mode="watch" working with remote playlist by periodically fetching it and reloading when the newer version is available. Periodic fetching interval can be defined through a parameter, e.g. refresh_interval=10 (fetch remote playlist every 10 seconds).

@iSerganov iSerganov changed the title Watch changes in a remote playlist [Feature request]: Watch changes in a remote playlist Jul 12, 2024
@toots
Copy link
Member

toots commented Jul 18, 2024

Hi!

Thanks for submitting. While we should probably add this to the operator, you can always implement it by using the reload method of the playlist source:

s = playlist("...")
# Check on the remote playlist
s.reload()

@iSerganov
Copy link
Author

Yes and no.
Yes - it will reload the playlist, no - it won't do it every time a change happens to the remote playlist.

@toots
Copy link
Member

toots commented Jul 18, 2024

You can always use thread.run to run a recurrent check inside your own liquidsoap script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants