mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Fix incorrect field.
This commit is contained in:
parent
cd6e63130b
commit
9d8117239f
2 changed files with 13 additions and 6 deletions
|
@ -22,6 +22,7 @@ import org.schabi.newpipe.extractor.stream.StreamInfo;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamType;
|
import org.schabi.newpipe.extractor.stream.StreamType;
|
||||||
import org.schabi.newpipe.extractor.utils.JsonUtils;
|
import org.schabi.newpipe.extractor.utils.JsonUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.TimeoutException;
|
import java.util.concurrent.TimeoutException;
|
||||||
|
@ -150,11 +151,17 @@ public class StreamHandlers {
|
||||||
|
|
||||||
if (info.getUploadDate() != null && System.currentTimeMillis() - time < TimeUnit.DAYS.toMillis(Constants.FEED_RETENTION)) {
|
if (info.getUploadDate() != null && System.currentTimeMillis() - time < TimeUnit.DAYS.toMillis(Constants.FEED_RETENTION)) {
|
||||||
VideoHelpers.updateVideo(info.getId(), info, time);
|
VideoHelpers.updateVideo(info.getId(), info, time);
|
||||||
MatrixHelper.sendEvent("video.piped.stream.info", new FederatedVideoInfo(
|
Multithreading.runAsync(() -> {
|
||||||
info.getId(), StringUtils.substring(info.getUploaderUrl(), -24),
|
try {
|
||||||
info.getName(),
|
MatrixHelper.sendEvent("video.piped.stream.info", new FederatedVideoInfo(
|
||||||
info.getDuration(), info.getViewCount())
|
info.getId(), StringUtils.substring(info.getUploaderUrl(), -24),
|
||||||
);
|
info.getName(),
|
||||||
|
info.getDuration(), info.getViewCount())
|
||||||
|
);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String lbryId;
|
String lbryId;
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class MatrixHelper {
|
||||||
.put(RequestBody.create(mapper.writeValueAsBytes(
|
.put(RequestBody.create(mapper.writeValueAsBytes(
|
||||||
mapper.createObjectNode()
|
mapper.createObjectNode()
|
||||||
.put("msgtype", type)
|
.put("msgtype", type)
|
||||||
.set("body", mapper.valueToTree(content))
|
.set("content", mapper.valueToTree(content))
|
||||||
), MediaType.get("application/json")))
|
), MediaType.get("application/json")))
|
||||||
.build()
|
.build()
|
||||||
).get("event_id").asText();
|
).get("event_id").asText();
|
||||||
|
|
Loading…
Reference in a new issue