live support catchup config

pull/362/head
FongMi 2 years ago
parent 628841ce16
commit b2e68f2af1
  1. 1
      app/src/main/java/com/fongmi/android/tv/api/LiveParser.java
  2. 9
      app/src/main/java/com/fongmi/android/tv/bean/Channel.java
  3. 8
      app/src/main/java/com/fongmi/android/tv/bean/Live.java

@ -1,7 +1,6 @@
package com.fongmi.android.tv.api;
import android.util.Base64;
import android.util.Log;
import com.fongmi.android.tv.bean.Catchup;
import com.fongmi.android.tv.bean.Channel;

@ -159,7 +159,7 @@ public class Channel {
}
public Catchup getCatchup() {
return catchup;
return catchup == null ? new Catchup() : catchup;
}
public void setCatchup(Catchup catchup) {
@ -287,9 +287,9 @@ public class Channel {
}
public boolean hasCatchup() {
if (getCatchup() == null && getCurrent().contains("/PLTV/")) setCatchup(Catchup.PLTV());
if (getCatchup() != null && !getCatchup().getRegex().isEmpty()) return getCatchup().match(getCurrent());
return getCatchup() != null && !getCatchup().isEmpty();
if (getCatchup().isEmpty() && getCurrent().contains("/PLTV/")) setCatchup(Catchup.PLTV());
if (!getCatchup().getRegex().isEmpty()) return getCatchup().match(getCurrent());
return !getCatchup().isEmpty();
}
public String getLineText() {
@ -313,6 +313,7 @@ public class Channel {
if (live.getHeader() != null && getHeader() == null) setHeader(live.getHeader());
if (live.getClick().length() > 0 && getClick().isEmpty()) setClick(live.getClick());
if (live.getOrigin().length() > 0 && getOrigin().isEmpty()) setOrigin(live.getOrigin());
if (!live.getCatchup().isEmpty() && getCatchup().isEmpty()) setCatchup(live.getCatchup());
if (live.getReferer().length() > 0 && getReferer().isEmpty()) setReferer(live.getReferer());
if (live.getPlayerType() != -1 && getPlayerType() == -1) setPlayerType(live.getPlayerType());
if (!getEpg().startsWith("http")) setEpg(live.getEpg().replace("{name}", getName()).replace("{epg}", getEpg()));

@ -90,6 +90,10 @@ public class Live {
@SerializedName("groups")
private List<Group> groups;
@Ignore
@SerializedName("catchup")
private Catchup catchup;
@Ignore
@SerializedName("core")
private Core core;
@ -213,6 +217,10 @@ public class Live {
return groups = groups == null ? new ArrayList<>() : groups;
}
public Catchup getCatchup() {
return catchup == null ? new Catchup() : catchup;
}
public Core getCore() {
return core == null ? new Core() : core;
}

Loading…
Cancel
Save