Clarify Priority calling order

Altered pre-connection logic to make reason settable
Optionally cancel connection if recorder is used and fails to find record url!
This commit is contained in:
kohlerpop1
2025-02-19 13:18:25 -05:00
parent 28ef3562b6
commit 735bdfbb10
6 changed files with 61 additions and 11 deletions

View File

@@ -63,12 +63,14 @@ public class RecorderListener implements LiveRecorder {
liveClient.getLogger().info("Searching for live download url");
downloadData = settings.getPrepareDownloadData() != null ?
settings.getPrepareDownloadData().apply(json) :
mapToDownloadData(json);
settings.getPrepareDownloadData().apply(json) :
mapToDownloadData(json);
if (downloadData.getDownloadLiveUrl().isEmpty())
liveClient.getLogger().warning("Unable to find download live url!");
else
if (downloadData.getDownloadLiveUrl().isEmpty()) {
liveClient.getLogger().warning("Unable to find download live url!");
if (settings.isCancelConnectionIfNotFound())
event.setCancelConnection(true, "Unable to find download live url!");
} else
liveClient.getLogger().info("Live download url found!");
}

View File

@@ -40,6 +40,10 @@ public class RecorderSettings {
private File outputFile;
private Function<String,DownloadData> prepareDownloadData;
private boolean stopOnDisconnect = true;
/**
True to Cancel connection to live if the download url is not found
*/
private boolean cancelConnectionIfNotFound = false;
public static RecorderSettings DEFAULT() {
return new RecorderSettings();