mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 08:49:40 -05:00
Moved ActionResult#message to top of toJson() for easier reading
Change Recording settings to accept an output file instead of directory and filename
This commit is contained in:
@@ -100,8 +100,8 @@ public class ActionResult<T> {
|
|||||||
public JsonObject toJson() {
|
public JsonObject toJson() {
|
||||||
JsonObject map = new JsonObject();
|
JsonObject map = new JsonObject();
|
||||||
map.addProperty("success", success);
|
map.addProperty("success", success);
|
||||||
map.add("content", gson.toJsonTree(content));
|
|
||||||
map.addProperty("message", message);
|
map.addProperty("message", message);
|
||||||
|
map.add("content", gson.toJsonTree(content));
|
||||||
map.add("previous", hasPrevious() ? previous.toJson() : null);
|
map.add("previous", hasPrevious() ? previous.toJson() : null);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,8 +87,7 @@ public class RecorderListener implements LiveRecorder {
|
|||||||
connection.setRequestProperty(entry.getKey(), entry.getValue());
|
connection.setRequestProperty(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
var path = settings.getOutputPath() + File.separator + settings.getOutputFileName();
|
var file = settings.getOutputFile();
|
||||||
var file = new File(path);
|
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
|
|
||||||
@@ -113,10 +112,9 @@ public class RecorderListener implements LiveRecorder {
|
|||||||
|
|
||||||
var recordingStartedEvent = new TikTokLiveRecorderStartedEvent(downloadData);
|
var recordingStartedEvent = new TikTokLiveRecorderStartedEvent(downloadData);
|
||||||
liveClient.publishEvent(recordingStartedEvent);
|
liveClient.publishEvent(recordingStartedEvent);
|
||||||
if (recordingStartedEvent.isCanceled()) {
|
if (recordingStartedEvent.isCanceled())
|
||||||
liveClient.getLogger().info("Recording cancelled");
|
liveClient.getLogger().info("Recording cancelled");
|
||||||
return;
|
else
|
||||||
}
|
|
||||||
liveDownloadThread.start();
|
liveDownloadThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import io.github.jwdeveloper.tiktok.extension.recorder.impl.enums.LiveFormat;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -36,8 +37,7 @@ public class RecorderSettings {
|
|||||||
private String ffmpegPath;
|
private String ffmpegPath;
|
||||||
private String quality;
|
private String quality;
|
||||||
private String format;
|
private String format;
|
||||||
private String outputPath;
|
private File outputFile;
|
||||||
private String outputFileName;
|
|
||||||
private Function<String,DownloadData> prepareDownloadData;
|
private Function<String,DownloadData> prepareDownloadData;
|
||||||
private boolean startOnConnected;
|
private boolean startOnConnected;
|
||||||
private boolean stopOnDisconnect = true;
|
private boolean stopOnDisconnect = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user