FongMi 4 weeks ago
parent e26ccfb128
commit f1efdeea78
  1. 3
      app/src/main/java/com/fongmi/android/tv/model/LiveViewModel.java
  2. 14
      app/src/main/java/com/fongmi/android/tv/player/ParseJob.java
  3. 2
      app/src/main/java/com/fongmi/android/tv/server/Nano.java

@ -90,7 +90,8 @@ public class LiveViewModel extends ViewModel {
private boolean parseXml(Live item, String url) {
try {
return EpgParser.start(item, url);
EpgParser.start(item, url);
return true;
} catch (Exception ignored) {
return false;
}

@ -93,20 +93,20 @@ public class ParseJob implements ParseCallback {
private void doInBackground(String key, String webUrl, String flag) throws Throwable {
switch (parse.getType()) {
case 0: //嗅探
case 0:
startWeb(key, parse, webUrl);
break;
case 1: //Json
case 1:
jsonParse(parse, webUrl, true);
break;
case 2: //Json擴展
case 2:
jsonExtend(webUrl);
break;
case 3: //Json聚合
case 3:
jsonMix(webUrl, flag);
break;
case 4: //超級解析
godParse(webUrl, flag);
case 4:
superParse(webUrl, flag);
break;
}
}
@ -133,7 +133,7 @@ public class ParseJob implements ParseCallback {
checkResult(Result.fromObject(BaseLoader.get().jsonExtMix(flag, parse.getUrl(), parse.getName(), jxs, webUrl)));
}
private void godParse(String webUrl, String flag) throws Exception {
private void superParse(String webUrl, String flag) throws Exception {
List<Parse> json = VodConfig.get().getParses(1, flag);
List<Parse> webs = VodConfig.get().getParses(0, flag);
int count = json.size() + (webs.isEmpty() ? 0 : 1);

@ -80,7 +80,7 @@ public class Nano extends NanoHTTPD {
try {
if (path.isEmpty()) path = INDEX;
InputStream is = Asset.open(path);
return newFixedLengthResponse(Response.Status.OK, getMimeTypeForFile(path), is, is.available());
return newFixedLengthResponse(Response.Status.OK, getMimeTypeForFile(path), is, -1);
} catch (Exception e) {
return newFixedLengthResponse(Response.Status.NOT_FOUND, MIME_HTML, null, 0);
}

Loading…
Cancel
Save