liquidsoap
liquidsoap copied to clipboard
`on_track_end` callback
We really need a callback to be triggered when a source's track ends. It's a little tricky to define b/c of the streaming model, which is why I haven't added one for 2.0.0
but I definitely would like to add one for 2.1.0
Hi, I would like to delete my media file once it has been streamed. I get in log: "Finished with " (and my file URI) which i see is generated by https://github.com/savonet/liquidsoap/blob/499befcaf6296b9f65fe74bd0f573db8c798dc83/src/sources/request_source.ml#L164 anyway i can do this ?
Hi, I would like to delete my media file once it has been streamed. I get in log: "Finished with " (and my file URI) which i see is generated by
https://github.com/savonet/liquidsoap/blob/499befcaf6296b9f65fe74bd0f573db8c798dc83/src/sources/request_source.ml#L164
anyway i can do this ?
How do you queue your files? Files downloaded from remote URLs are always deleted after being played.
Files (local) are queued via socket connection and push command Since posting this i worked out that i can prefix the file path with tmp: and then LS deletes them whon done. But still might be nice to have a call back at finished when.
Yes, good catch on tmp:
! I agree with you that this would be useful nonetheless.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello! Wondering if there's any updates on this? I would like to have LS do a HTTP request at the end of each track.
I'm currently doing it by having a callback on on_track
, and calculate the previous track based on the playlist, but it only works well when the playlist mode is set to normal
Thanks :)
Hi! I think the best for us would be to wait for the v2.3.x
release cycle where we're planning to rewrite the streaming model. Meanwhile, Have you tried to look at source.on_end ? You should be able to trigger a callback very shortly before the end of a track.
Sounds good! yes, for now I'm doing a workaround with source.on_end
and it works well, albeit with some slightly unpleasant edge-case handling ;)