52 lines
1.1 KiB
Go
52 lines
1.1 KiB
Go
|
package anilist
|
||
|
|
||
|
func (api *Api) GetMediaList(vars MediaListQuery, onError func(error)) <-chan *MediaList {
|
||
|
resp := responseObj[*page[MediaList]]{}
|
||
|
return requestPaged(api, getMediaListQuery, vars.toMap(), &resp, onError)
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
getMediaListQuery = `query (
|
||
|
$id: Int,
|
||
|
$userId: Int,
|
||
|
$userName: String,
|
||
|
$type: MediaType,
|
||
|
$status: MediaListStatus,
|
||
|
$mediaId: Int,
|
||
|
$isFollowing: Boolean,
|
||
|
$notes: String,
|
||
|
$userId_in: [Int],
|
||
|
$status_in: [MediaListStatus],
|
||
|
$status_not_in: [MediaListStatus],
|
||
|
$status_not: MediaListStatus,
|
||
|
$mediaId_in: [Int],
|
||
|
$mediaId_not_in: [Int],
|
||
|
$sort: [MediaListSort],
|
||
|
$page: Int
|
||
|
)
|
||
|
|
||
|
{
|
||
|
Page (page: $page) {
|
||
|
pageInfo ` + subSelectionPageInfo + `
|
||
|
|
||
|
mediaList (
|
||
|
id: $id,
|
||
|
userId: $userId,
|
||
|
userName: $userName,
|
||
|
type: $type,
|
||
|
status: $status,
|
||
|
mediaId: $mediaId,
|
||
|
isFollowing: $isFollowing,
|
||
|
notes: $notes,
|
||
|
userId_in: $userId_in,
|
||
|
status_in: $status_in,
|
||
|
status_not_in: $status_not_in,
|
||
|
status_not: $status_not,
|
||
|
mediaId_in: $mediaId_in,
|
||
|
mediaId_not_in: $mediaId_not_in,
|
||
|
sort: $sort
|
||
|
) ` + subSelectionMediaList + `
|
||
|
}
|
||
|
}`
|
||
|
)
|