mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
feat(sponsorblock): handle nullable actionType
This commit is contained in:
parent
eecff5378d
commit
9f30df1f80
1 changed files with 6 additions and 3 deletions
|
@ -30,11 +30,14 @@ public class SponsorBlockUtils {
|
|||
|
||||
String hash = DigestUtils.sha256Hex(id);
|
||||
|
||||
for (String url : Constants.SPONSORBLOCK_SERVERS) {
|
||||
for (String apiUrl : Constants.SPONSORBLOCK_SERVERS) {
|
||||
try {
|
||||
String url =apiUrl + "/api/skipSegments/" + URLUtils.silentEncode(hash.substring(0, 4))
|
||||
+ "?categories=" + URLUtils.silentEncode(categories);
|
||||
if (actionType != null && !actionType.isBlank())
|
||||
url += "&actionTypes=" + URLUtils.silentEncode(actionType);
|
||||
|
||||
var resp = RequestUtils.sendGetRaw(url + "/api/skipSegments/" + URLUtils.silentEncode(hash.substring(0, 4))
|
||||
+ "?categories=" + URLUtils.silentEncode(categories) + "&actionTypes=" + URLUtils.silentEncode(actionType)).get();
|
||||
var resp = RequestUtils.sendGetRaw(url).get();
|
||||
|
||||
if (resp.status() == 200) {
|
||||
var any = mapper.readTree(resp.body());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue