Фикс метода get_score
This commit is contained in:
@ -47,9 +47,9 @@ 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, score_id: int):
|
async def get_score(self, access_token: str, mode: str, score_id: int):
|
||||||
req = await self.get(
|
req = await self.get(
|
||||||
f'/scores/{score_id}',
|
f'/scores/{mode}/{score_id}',
|
||||||
headers=self.clean_dict(
|
headers=self.clean_dict(
|
||||||
{
|
{
|
||||||
'Authorization': f'Bearer {access_token}',
|
'Authorization': f'Bearer {access_token}',
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class Country(BaseModel):
|
|||||||
class Cover(BaseModel):
|
class Cover(BaseModel):
|
||||||
model_config = ConfigDict(extra='forbid')
|
model_config = ConfigDict(extra='forbid')
|
||||||
|
|
||||||
custom_url: str
|
custom_url: str | None
|
||||||
url: str
|
url: str
|
||||||
id: int | None
|
id: int | None
|
||||||
|
|
||||||
@ -211,38 +211,6 @@ class Covers(BaseModel):
|
|||||||
slimcover_2x: str = Field(..., alias='slimcover@2x')
|
slimcover_2x: str = Field(..., alias='slimcover@2x')
|
||||||
|
|
||||||
|
|
||||||
class Beatmap(BaseModel):
|
|
||||||
model_config = ConfigDict(extra='forbid')
|
|
||||||
|
|
||||||
beatmapset_id: int
|
|
||||||
difficulty_rating: float
|
|
||||||
id: int
|
|
||||||
mode: str
|
|
||||||
status: str
|
|
||||||
total_length: int
|
|
||||||
user_id: int
|
|
||||||
version: str
|
|
||||||
accuracy: float
|
|
||||||
ar: float
|
|
||||||
bpm: float
|
|
||||||
convert: bool
|
|
||||||
count_circles: int
|
|
||||||
count_sliders: int
|
|
||||||
count_spinners: int
|
|
||||||
cs: float
|
|
||||||
deleted_at: datetime | None
|
|
||||||
drain: float
|
|
||||||
hit_length: int
|
|
||||||
is_scoreable: bool
|
|
||||||
last_updated: str
|
|
||||||
mode_int: int
|
|
||||||
passcount: int
|
|
||||||
playcount: int
|
|
||||||
ranked: int
|
|
||||||
url: str
|
|
||||||
checksum: str
|
|
||||||
|
|
||||||
|
|
||||||
class Beatmapset(BaseModel):
|
class Beatmapset(BaseModel):
|
||||||
model_config = ConfigDict(extra='forbid')
|
model_config = ConfigDict(extra='forbid')
|
||||||
|
|
||||||
@ -284,8 +252,12 @@ class User(BaseModel):
|
|||||||
is_supporter: bool
|
is_supporter: bool
|
||||||
last_visit: datetime | None
|
last_visit: datetime | None
|
||||||
pm_friends_only: bool
|
pm_friends_only: bool
|
||||||
profile_colour: None
|
profile_colour: str | None
|
||||||
username: str
|
username: str
|
||||||
|
country: Country | None = None
|
||||||
|
team: Team | None = None
|
||||||
|
cover: Cover | None = None
|
||||||
|
groups: list[str] | None = None
|
||||||
|
|
||||||
|
|
||||||
class Weight(BaseModel):
|
class Weight(BaseModel):
|
||||||
@ -353,13 +325,48 @@ class BeatmapFailtimes(BaseModel):
|
|||||||
exit: list[int]
|
exit: list[int]
|
||||||
|
|
||||||
|
|
||||||
|
class Beatmap(BaseModel):
|
||||||
|
model_config = ConfigDict(extra='forbid')
|
||||||
|
|
||||||
|
beatmapset_id: int
|
||||||
|
difficulty_rating: float
|
||||||
|
id: int
|
||||||
|
mode: str
|
||||||
|
status: str
|
||||||
|
total_length: int
|
||||||
|
user_id: int
|
||||||
|
version: str
|
||||||
|
accuracy: float
|
||||||
|
ar: float
|
||||||
|
bpm: float
|
||||||
|
convert: bool
|
||||||
|
count_circles: int
|
||||||
|
count_sliders: int
|
||||||
|
count_spinners: int
|
||||||
|
cs: float
|
||||||
|
deleted_at: datetime | None
|
||||||
|
drain: float
|
||||||
|
hit_length: int
|
||||||
|
is_scoreable: bool
|
||||||
|
last_updated: str
|
||||||
|
mode_int: int
|
||||||
|
passcount: int
|
||||||
|
playcount: int
|
||||||
|
ranked: int
|
||||||
|
url: str
|
||||||
|
checksum: str
|
||||||
|
max_combo: int | None = None
|
||||||
|
owners: list[BeatmapOwner] | None = None
|
||||||
|
user: User | None = None
|
||||||
|
|
||||||
|
|
||||||
class BeatmapExtended(Beatmap):
|
class BeatmapExtended(Beatmap):
|
||||||
model_config = ConfigDict(extra='forbid')
|
model_config = ConfigDict(extra='forbid')
|
||||||
|
|
||||||
beatmapset: BeatmapsetExtended
|
beatmapset: BeatmapsetExtended
|
||||||
max_combo: int
|
max_combo: int # type: ignore
|
||||||
current_user_playcount: int
|
current_user_playcount: int
|
||||||
owners: list[BeatmapOwner]
|
owners: list[BeatmapOwner] # type: ignore
|
||||||
failtimes: BeatmapFailtimes
|
failtimes: BeatmapFailtimes
|
||||||
|
|
||||||
|
|
||||||
@ -388,6 +395,7 @@ class Score(BaseModel):
|
|||||||
beatmapset: Beatmapset
|
beatmapset: Beatmapset
|
||||||
user: User
|
user: User
|
||||||
weight: Weight | None = None
|
weight: Weight | None = None
|
||||||
|
rank_global: int | None = None
|
||||||
|
|
||||||
|
|
||||||
class GetUser(User):
|
class GetUser(User):
|
||||||
@ -411,8 +419,8 @@ class GetUser(User):
|
|||||||
title_url: None
|
title_url: None
|
||||||
twitter: str | None
|
twitter: str | None
|
||||||
website: str | None
|
website: str | None
|
||||||
country: Country
|
country: Country # type: ignore
|
||||||
cover: Cover
|
cover: Cover # type: ignore
|
||||||
kudosu: Kudosu
|
kudosu: Kudosu
|
||||||
account_history: list[str]
|
account_history: list[str]
|
||||||
active_tournament_banner: ActiveTournamentBanner | None
|
active_tournament_banner: ActiveTournamentBanner | None
|
||||||
@ -425,7 +433,7 @@ class GetUser(User):
|
|||||||
favourite_beatmapset_count: int
|
favourite_beatmapset_count: int
|
||||||
follower_count: int
|
follower_count: int
|
||||||
graveyard_beatmapset_count: int
|
graveyard_beatmapset_count: int
|
||||||
groups: list[str]
|
groups: list[str] # type: ignore
|
||||||
guest_beatmapset_count: int
|
guest_beatmapset_count: int
|
||||||
loved_beatmapset_count: int
|
loved_beatmapset_count: int
|
||||||
mapping_follower_count: int
|
mapping_follower_count: int
|
||||||
@ -443,7 +451,6 @@ class GetUser(User):
|
|||||||
scores_recent_count: int
|
scores_recent_count: int
|
||||||
statistics: UserStatistics
|
statistics: UserStatistics
|
||||||
support_level: int
|
support_level: int
|
||||||
team: Team | None
|
|
||||||
user_achievements: list[UserAchievement]
|
user_achievements: list[UserAchievement]
|
||||||
rank_history: RankHistory
|
rank_history: RankHistory
|
||||||
rankHistory: RankHistory
|
rankHistory: RankHistory
|
||||||
|
|||||||
Reference in New Issue
Block a user