From 4fcd5089bbdf9be6bc73966d28aefcae99f16da6 Mon Sep 17 00:00:00 2001 From: FongMi Date: Mon, 22 Jan 2024 13:37:12 +0800 Subject: [PATCH] Clean code --- .../com/fongmi/android/tv/model/LiveViewModel.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/app/src/main/java/com/fongmi/android/tv/model/LiveViewModel.java b/app/src/main/java/com/fongmi/android/tv/model/LiveViewModel.java index b51edd22e..c9f10493b 100644 --- a/app/src/main/java/com/fongmi/android/tv/model/LiveViewModel.java +++ b/app/src/main/java/com/fongmi/android/tv/model/LiveViewModel.java @@ -14,7 +14,6 @@ import com.fongmi.android.tv.player.Source; import com.github.catvod.net.OkHttp; import java.text.SimpleDateFormat; -import java.util.Calendar; import java.util.Date; import java.util.Iterator; import java.util.Locale; @@ -30,7 +29,6 @@ public class LiveViewModel extends ViewModel { private static final int URL = 2; private final SimpleDateFormat formatDate; - private final SimpleDateFormat formatSeek; private final SimpleDateFormat formatTime; public MutableLiveData url; @@ -43,7 +41,6 @@ public class LiveViewModel extends ViewModel { public LiveViewModel() { this.formatTime = new SimpleDateFormat("yyyy-MM-ddHH:mm", Locale.getDefault()); - this.formatSeek = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()); this.formatDate = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); this.live = new MutableLiveData<>(); this.epg = new MutableLiveData<>(); @@ -74,7 +71,6 @@ public class LiveViewModel extends ViewModel { item.setMsg(null); Source.get().stop(); item.setUrl(Source.get().fetch(item)); - //checkPLTV(item); return item; }); } @@ -84,14 +80,6 @@ public class LiveViewModel extends ViewModel { while (iterator.hasNext()) if (iterator.next().isEmpty()) iterator.remove(); } - private void checkPLTV(Channel item) { - if (!item.getUrl().contains("/PLTV/")) return; - Calendar calendar = Calendar.getInstance(); - String endTime = formatSeek.format(calendar.getTime()); - String startTime = formatSeek.format(calendar.getTime()); - item.setUrl(item.getUrl().replace("/PLTV/", "/TVOD/") + "?playseek=" + startTime + "-" + endTime); - } - private void execute(int type, Callable callable) { switch (type) { case LIVE: