WTF: rebel pls fix it
This commit is contained in:
parent
36c64951c7
commit
8da0092561
8 changed files with 170 additions and 16 deletions
|
@ -1254,6 +1254,7 @@ Page(page:$page,perPage:50) {
|
|||
show = true
|
||||
)
|
||||
}
|
||||
|
||||
suspend fun userFavMedia(anime: Boolean, id: Int): ArrayList<Media> {
|
||||
var hasNextPage = true
|
||||
var page = 0
|
||||
|
@ -1280,6 +1281,9 @@ Page(page:$page,perPage:50) {
|
|||
private fun userFavMediaQuery(anime: Boolean, page: Int, id: Int): String {
|
||||
return """User(id:${id}){id favourites{${if (anime) "anime" else "manga"}(page:$page){pageInfo{hasNextPage}edges{favouriteOrder node{id idMal isAdult mediaListEntry{ progress private score(format:POINT_100) status } chapters isFavourite format episodes nextAiringEpisode{episode}meanScore isFavourite format startDate{year month day} title{english romaji userPreferred}type status(version:2)bannerImage coverImage{large}}}}}}"""
|
||||
}
|
||||
suspend fun userFollowing(id: Int): Query.Following?{
|
||||
return executeQuery<Query.Following>("""{Following:Page {following(userId:${id},sort:[USERNAME]){id name avatar{large medium}bannerImage}}}""", force = true)
|
||||
}
|
||||
private suspend fun userBannerImage(type: String,id: Int?): String? {
|
||||
val response =
|
||||
executeQuery<Query.MediaListCollection>("""{ MediaListCollection(userId: ${id}, type: $type, chunk:1,perChunk:25, sort: [SCORE_DESC,UPDATED_TIME_DESC]) { lists { entries{ media { id bannerImage } } } } } """)
|
||||
|
|
|
@ -199,7 +199,17 @@ class Query {
|
|||
val user: UserProfile?
|
||||
)
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class Following(
|
||||
@SerialName("data")
|
||||
val data: Data
|
||||
) {
|
||||
@Serializable
|
||||
data class Data(
|
||||
@SerialName("following")
|
||||
val following: ani.dantotsu.connections.anilist.api.User?
|
||||
)
|
||||
}
|
||||
@Serializable
|
||||
data class UserProfile(
|
||||
@SerialName("id")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue