Implement getUserBeatmapScores
This commit is contained in:
parent
aea087af64
commit
e0cabfefcf
@ -214,6 +214,20 @@ class OsuApi(
|
||||
}
|
||||
}
|
||||
|
||||
fun getUserBeatmapScores(userId: Long, beatmapId: Int): OsuApiModels.BeatmapScores? {
|
||||
val response = doRequest("https://osu.ppy.sh/api/v2/beatmaps/$beatmapId/scores/users/$userId/all", mapOf())
|
||||
|
||||
if(response == null) {
|
||||
this.logger.info("Error getting scores on beatmap $beatmapId for user $userId")
|
||||
return null
|
||||
}
|
||||
|
||||
return when (response.statusCode()) {
|
||||
200 -> serializer.decodeFromString<OsuApiModels.BeatmapScores>(response.body())
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
fun searchBeatmapsets(cursor: OsuApiModels.BeatmapsetSearchResultCursor?): OsuApiModels.BeatmapsetSearchResult? {
|
||||
val queryParams = mutableMapOf(
|
||||
"s" to "ranked", // Status [only ranked]
|
||||
@ -294,7 +308,7 @@ class OsuApi(
|
||||
}
|
||||
}
|
||||
|
||||
fun getUserMostPlayed(userId: Int, limit: Int? = null, offset: Int? = null): List<OsuApiModels.BeatmapPlaycount>? {
|
||||
fun getUserMostPlayed(userId: Long, limit: Int? = null, offset: Int? = null): List<OsuApiModels.BeatmapPlaycount>? {
|
||||
val queryParams = mapOf(
|
||||
"limit" to limit,
|
||||
"offset" to offset,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user