fix: show only trusted
This commit is contained in:
parent
91f728150c
commit
1dd3bddeb9
1 changed files with 11 additions and 10 deletions
|
@ -1,26 +1,27 @@
|
||||||
package ani.dantotsu.connections.github
|
package ani.dantotsu.connections.github
|
||||||
|
|
||||||
import ani.dantotsu.Mapper
|
|
||||||
import ani.dantotsu.client
|
|
||||||
import ani.dantotsu.settings.Developer
|
import ani.dantotsu.settings.Developer
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.json.JsonArray
|
|
||||||
import kotlinx.serialization.json.decodeFromJsonElement
|
|
||||||
|
|
||||||
class Forks {
|
class Forks {
|
||||||
|
|
||||||
fun getForks(): Array<Developer> {
|
fun getForks(): Array<Developer> {
|
||||||
var forks = arrayOf<Developer>()
|
var forks = arrayOf<Developer>()
|
||||||
runBlocking(Dispatchers.IO) {
|
runBlocking(Dispatchers.IO) {
|
||||||
val res =
|
val trustedForks = arrayOf(
|
||||||
client.get("https://api.github.com/repos/rebelonion/Dantotsu/forks?sort=stargazers")
|
GithubResponse(
|
||||||
.parsed<JsonArray>().map {
|
"Awery",
|
||||||
Mapper.json.decodeFromJsonElement<GithubResponse>(it)
|
GithubResponse.Owner(
|
||||||
}
|
"MrBoomDeveloper",
|
||||||
res.forEach {
|
"https://avatars.githubusercontent.com/u/92123190?v=4"
|
||||||
|
),
|
||||||
|
"https://github.com/MrBoomDeveloper/Awery"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
trustedForks.forEach {
|
||||||
forks = forks.plus(
|
forks = forks.plus(
|
||||||
Developer(
|
Developer(
|
||||||
it.name,
|
it.name,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue