From 4faf5e91e61ba651894480d6adaef15e01571fa5 Mon Sep 17 00:00:00 2001 From: Romain Beauxis Date: Tue, 31 Oct 2023 16:14:05 -0500 Subject: [PATCH] Drop default on_fail. (#3479) --- src/libs/playlist.liq | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/libs/playlist.liq b/src/libs/playlist.liq index 932a91a744..637bcabb04 100644 --- a/src/libs/playlist.liq +++ b/src/libs/playlist.liq @@ -342,6 +342,7 @@ end # whole round ("randomize" mode), or pick a random file in the playlist each time \ # ("random" mode). # @param ~native Use native implementation. +# @param ~on_fail Function executed when too many requests failed and returning the contents of a fixed playlist. # @param ~on_reload Callback called after playlist has reloaded. # @param ~prefix Add a constant prefix to all requests. Useful for passing extra \ # information using annotate, or for resolution through a particular protocol, \ @@ -364,6 +365,7 @@ def replaces playlist( ~mime_type=null(), ~mode="randomize", ~native=false, + ~on_fail=null(), ~on_reload=(fun (_) -> ()), ~prefix="", ~reload=0, @@ -409,28 +411,6 @@ def replaces playlist( list.map.right(fun (file) -> prefix ^ file, files) end - # Try to reload playlist when the playlist is looped and has failed. - def on_fail() = - l = load_playlist() - if - l == [] - then - log.info( - "Failed to reload playlist after failure." - ) - - # We add a dummy request in order for the playlist not to stop. - ["???failed???"] - else - log.info( - "Successfully reload playlist after failure." - ) - l - end - end - - on_fail = if loop then on_fail else null() end - # Create the source files := load_playlist()