feat : qol things

This commit is contained in:
aayush262
2024-05-22 00:20:59 +05:30
parent 039e3d63fe
commit 48ccb2c581
9 changed files with 98 additions and 110 deletions

View File

@@ -1,55 +0,0 @@
package ani.dantotsu.connections.github
import ani.dantotsu.settings.Developer
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
class Forks {
fun getForks(): Array<Developer> {
var forks = arrayOf<Developer>()
runBlocking(Dispatchers.IO) {
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,
it.owner.avatarUrl,
it.owner.login,
it.htmlUrl
)
)
}
}
return forks
}
@Serializable
data class GithubResponse(
@SerialName("name")
val name: String,
val owner: Owner,
@SerialName("html_url")
val htmlUrl: String,
) {
@Serializable
data class Owner(
@SerialName("login")
val login: String,
@SerialName("avatar_url")
val avatarUrl: String
)
}
}