Fix live group logo

pull/183/head
FongMi 3 years ago
parent 2f65dd88ec
commit 4265ae2a4b
  1. 2
      app/src/main/java/com/fongmi/android/tv/api/LiveParser.java
  2. 5
      app/src/main/java/com/fongmi/android/tv/bean/Group.java

@ -48,7 +48,7 @@ public class LiveParser {
private static void json(Live live, String text) {
live.getGroups().addAll(Group.arrayFrom(text));
for (Group group : live.getGroups()) {
for (Channel channel : group.getChannel()) {
for (Channel channel : group.live(live).getChannel()) {
channel.live(live);
}
}

@ -143,6 +143,11 @@ public class Group {
else getChannel().get(index).getUrls().addAll(channel.getUrls());
}
public Group live(Live live) {
if (!getLogo().startsWith("http")) setLogo(live.getLogo().replace("{name}", getName()).replace("{logo}", getLogo()));
return this;
}
public Channel find(Channel channel) {
int index = getChannel().indexOf(channel);
if (index != -1) return getChannel().get(index);

Loading…
Cancel
Save