Merge pull request #456 from okcaptain/dev

Dev
pull/457/head^2
okcaptain 2 years ago committed by GitHub
commit 9b1a8484b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      app/build.gradle
  2. 2
      app/src/main/java/com/fongmi/android/tv/Setting.java
  3. 4
      app/src/main/java/com/fongmi/android/tv/api/LiveParser.java

@ -10,8 +10,8 @@ android {
applicationId "com.fongmi.android.tv"
minSdk 21
targetSdk 28
versionCode 234
versionName "0524"
versionCode 235
versionName "2.3.5"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]

@ -315,7 +315,7 @@ public class Setting {
}
public static int getBackupMode() {
return Prefers.getInt("backup_mode");
return Prefers.getInt("backup_mode", 1);
}
public static void putBackupMode(int auto) {

@ -69,6 +69,7 @@ public class LiveParser {
Setting setting = Setting.create();
Catchup catchup = Catchup.create();
Channel channel = Channel.create("");
text = text.replace("\r\n", "\n");
for (String line : text.split("\n")) {
if (Thread.interrupted()) break;
if (setting.find(line)) {
@ -92,6 +93,7 @@ public class LiveParser {
private static void txt(Live live, String text) {
Setting setting = Setting.create();
text = text.replace("\r\n", "\n");
for (String line : text.split("\n")) {
if (Thread.interrupted()) break;
String[] split = line.split(",");
@ -102,7 +104,7 @@ public class LiveParser {
if (split.length > 1 && split[1].contains("://")) {
Group group = live.getGroups().get(live.getGroups().size() - 1);
Channel channel = group.find(Channel.create(split[0]));
channel.addUrls(split[1].split("#"));
channel.addUrls(line.substring(line.indexOf(",") + 1).split("#"));
setting.copy(channel);
}
}

Loading…
Cancel
Save