|
@@ -216,9 +216,9 @@ class ServerListViewModel(context: Context): ViewModel() {
|
|
val servers = serverListViewModelSplash.filterServersWithTvCountries(it)
|
|
val servers = serverListViewModelSplash.filterServersWithTvCountries(it)
|
|
serversListGlobal.add(index, ServerDataGlobal(serverData.name, servers))
|
|
serversListGlobal.add(index, ServerDataGlobal(serverData.name, servers))
|
|
|
|
|
|
- servers.forEachIndexed { index, server ->
|
|
|
|
- getServerGroupList(server, it, index)
|
|
|
|
- }
|
|
|
|
|
|
+// servers.forEachIndexed { index, server ->
|
|
|
|
+// getServerGroupList(server, it, index)
|
|
|
|
+// }
|
|
|
|
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -257,7 +257,8 @@ class ServerListViewModel(context: Context): ViewModel() {
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
- fun filterServersByISO(serverlist: ArrayList<Server>, isAlphabetList: Boolean = false): ArrayList<Server> {
|
|
|
|
|
|
+ fun filterServersByISO(serverlist: ArrayList<Server>,
|
|
|
|
+ isAlphabetList: Boolean = false): ArrayList<Server> {
|
|
|
|
|
|
serverlist.sortWith(Comparator { s1, s2 ->
|
|
serverlist.sortWith(Comparator { s1, s2 ->
|
|
return@Comparator s1.country_sort.compareTo(s2.country_sort)
|
|
return@Comparator s1.country_sort.compareTo(s2.country_sort)
|
|
@@ -418,6 +419,9 @@ class ServerListViewModel(context: Context): ViewModel() {
|
|
if (entry.key == value.country) {
|
|
if (entry.key == value.country) {
|
|
distinctBy.get(index).totalServers = entry.value.sumBy { it.totalServers }
|
|
distinctBy.get(index).totalServers = entry.value.sumBy { it.totalServers }
|
|
}
|
|
}
|
|
|
|
+ calculatePing(value) {
|
|
|
|
+ distinctBy.get(index).ping = it
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -506,6 +510,9 @@ class ServerListViewModel(context: Context): ViewModel() {
|
|
for ((index, value) in distinctBy.withIndex()) {
|
|
for ((index, value) in distinctBy.withIndex()) {
|
|
if (entry.key == value.country) {
|
|
if (entry.key == value.country) {
|
|
distinctBy.get(index).totalServers = entry.value.sumBy { it.totalServers }
|
|
distinctBy.get(index).totalServers = entry.value.sumBy { it.totalServers }
|
|
|
|
+ calculatePing(value) {
|
|
|
|
+ distinctBy.get(index).ping = it
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|