Фикс
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "osuclient"
|
name = "osuclient"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
description = "Client for osu! API"
|
description = "Client for osu! API"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [
|
authors = [
|
||||||
|
|||||||
@ -47,9 +47,16 @@ class osuAPIClient(AioHTTPXClient):
|
|||||||
case _:
|
case _:
|
||||||
raise s.Error(500, 'Internal Server Error')
|
raise s.Error(500, 'Internal Server Error')
|
||||||
|
|
||||||
async def get_score(self, access_token: str, mode: str, score_id: int):
|
async def get_score(
|
||||||
|
self,
|
||||||
|
access_token: str,
|
||||||
|
score_id: int,
|
||||||
|
mode: Literal['fruits', 'mania', 'osu', 'taiko'] | None = None,
|
||||||
|
):
|
||||||
|
url = f'/scores/{mode}/{score_id}' if mode else f'/scores/{score_id}'
|
||||||
|
|
||||||
req = await self.get(
|
req = await self.get(
|
||||||
f'/scores/{mode}/{score_id}',
|
url,
|
||||||
headers=self.clean_dict(
|
headers=self.clean_dict(
|
||||||
{
|
{
|
||||||
'Authorization': f'Bearer {access_token}',
|
'Authorization': f'Bearer {access_token}',
|
||||||
|
|||||||
@ -149,7 +149,7 @@ class UserAchievement(BaseModel):
|
|||||||
class RankHistory(BaseModel):
|
class RankHistory(BaseModel):
|
||||||
model_config = ConfigDict(extra='forbid')
|
model_config = ConfigDict(extra='forbid')
|
||||||
|
|
||||||
mode: str
|
mode: Literal['osu', 'taiko', 'fruits', 'mania']
|
||||||
data: list[int]
|
data: list[int]
|
||||||
|
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ class Beatmap(BaseModel):
|
|||||||
beatmapset_id: int
|
beatmapset_id: int
|
||||||
difficulty_rating: float
|
difficulty_rating: float
|
||||||
id: int
|
id: int
|
||||||
mode: str
|
mode: Literal['osu', 'taiko', 'fruits', 'mania']
|
||||||
status: str
|
status: str
|
||||||
total_length: int
|
total_length: int
|
||||||
user_id: int
|
user_id: int
|
||||||
@ -378,7 +378,7 @@ class Score(BaseModel):
|
|||||||
created_at: str
|
created_at: str
|
||||||
id: int
|
id: int
|
||||||
max_combo: int
|
max_combo: int
|
||||||
mode: str
|
mode: Literal['osu', 'taiko', 'fruits', 'mania']
|
||||||
mode_int: int
|
mode_int: int
|
||||||
mods: list[str]
|
mods: list[str]
|
||||||
passed: bool
|
passed: bool
|
||||||
|
|||||||
Reference in New Issue
Block a user