SourceViewModel.java+push

pull/99/head
watson1982 2 years ago committed by GitHub
parent 39293e0702
commit c2561a10ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      app/src/main/java/com/github/tvbox/osc/viewmodel/SourceViewModel.java

@ -38,6 +38,7 @@ import org.greenrobot.eventbus.EventBus;
import org.json.JSONObject;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
@ -427,7 +428,23 @@ public class SourceViewModel extends ViewModel {
}
}
// detailContent
public void getDetail(String sourceKey, String id) {
public void getDetail(String sourceKey, String urlid) {
if (urlid.startsWith("push://") && ApiConfig.get().getSource("push_agent") != null) {
String pushUrl = urlid.substring(7);
if (pushUrl.startsWith("b64:")) {
try {
pushUrl = new String(Base64.decode(pushUrl.substring(4), Base64.DEFAULT | Base64.URL_SAFE | Base64.NO_WRAP), "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
} else {
pushUrl = URLDecoder.decode(pushUrl);
}
sourceKey = "push_agent";
urlid = pushUrl;
}
String id = urlid;
SourceBean sourceBean = ApiConfig.get().getSource(sourceKey);
int type = sourceBean.getType();
if (type == 3) {

Loading…
Cancel
Save