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
|
||||
|
||||
import ani.dantotsu.Mapper
|
||||
import ani.dantotsu.client
|
||||
import ani.dantotsu.settings.Developer
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
import kotlinx.serialization.json.decodeFromJsonElement
|
||||
|
||||
class Forks {
|
||||
|
||||
fun getForks(): Array<Developer> {
|
||||
var forks = arrayOf<Developer>()
|
||||
runBlocking(Dispatchers.IO) {
|
||||
val res =
|
||||
client.get("https://api.github.com/repos/rebelonion/Dantotsu/forks?sort=stargazers")
|
||||
.parsed<JsonArray>().map {
|
||||
Mapper.json.decodeFromJsonElement<GithubResponse>(it)
|
||||
}
|
||||
res.forEach {
|
||||
val trustedForks = arrayOf(
|
||||
GithubResponse(
|
||||
"Awery",
|
||||
GithubResponse.Owner(
|
||||
"MrBoomDeveloper",
|
||||
"https://avatars.githubusercontent.com/u/92123190?v=4"
|
||||
),
|
||||
"https://github.com/MrBoomDeveloper/Awery"
|
||||
),
|
||||
)
|
||||
trustedForks.forEach {
|
||||
forks = forks.plus(
|
||||
Developer(
|
||||
it.name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue