Skip to content

Commit

Permalink
v2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
NiceAesth committed Jul 20, 2023
1 parent ccc3bc7 commit 712c441
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
28 changes: 27 additions & 1 deletion aiosu/models/beatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
from pydantic import model_validator

from .base import BaseModel
from .common import CurrentUserAttributes
from .common import CursorModel
from .gamemode import Gamemode
from .user import User

__all__ = (
"Beatmap",
"BeatmapDescription",
"BeatmapGenre",
"BeatmapLanguage",
"BeatmapAvailability",
"BeatmapCovers",
"BeatmapDifficultyAttributes",
Expand Down Expand Up @@ -137,6 +141,21 @@ def _missing_(cls, query: object) -> Any:
raise ValueError(f"BeatmapRankStatus {query} does not exist.")


class BeatmapDescription(BaseModel):
bbcode: Optional[str] = None
description: Optional[str] = None


class BeatmapGenre(BaseModel):
name: str
id: Optional[int] = None


class BeatmapLanguage(BaseModel):
name: str
id: Optional[int] = None


class BeatmapAvailability(BaseModel):
more_information: Optional[str] = None
download_disabled: Optional[bool] = None
Expand Down Expand Up @@ -344,10 +363,17 @@ class Beatmapset(BaseModel):
storyboard: Optional[bool] = None
submitted_date: Optional[datetime] = None
tags: Optional[str] = None
pack_tags: Optional[str] = None
pack_tags: Optional[list[str]] = None
track_id: Optional[int] = None
related_users: Optional[list[User]] = None
current_user_attributes: Optional[CurrentUserAttributes] = None
description: Optional[BeatmapDescription] = None
genre: Optional[BeatmapGenre] = None
language: Optional[BeatmapLanguage] = None
ratings: Optional[list[int]] = None
has_favourited: Optional[bool] = None
beatmaps: Optional[list[Beatmap]] = None
converts: Optional[list[Beatmap]] = None

@computed_field # type: ignore
@property
Expand Down
12 changes: 12 additions & 0 deletions aiosu/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ class PinAttributes(BaseModel):


class CurrentUserAttributes(BaseModel):
can_beatmap_update_owner: Optional[bool] = None
can_delete: Optional[bool] = None
can_edit_metadata: Optional[bool] = None
can_edit_tags: Optional[bool] = None
can_hype: Optional[bool] = None
can_hype_reason: Optional[str] = None
can_love: Optional[bool] = None
can_remove_from_loved: Optional[bool] = None
is_watching: Optional[bool] = None
new_hype_time: Optional[datetime] = None
nomination_modes: Optional[list[Gamemode]] = None
remaining_hype: Optional[int] = None
can_destroy: Optional[bool] = None
can_reopen: Optional[bool] = None
can_moderate_kudosu: Optional[bool] = None
Expand Down
2 changes: 1 addition & 1 deletion aiosu/models/oauthtoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OAuthToken(FrozenModel):
"""Defaults to 'Bearer'"""
access_token: str = ""
refresh_token: str = ""
expires_on: datetime = datetime.utcfromtimestamp(0)
expires_on: datetime = datetime.utcfromtimestamp(31536000)
"""Can be a datetime.datetime object or a string. Alternatively, expires_in may be passed representing the number of seconds the token will be valid for."""

@computed_field # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ show_error_codes = true
testpaths = ["tests"]
[tool.poetry]
name = "aiosu"
version = "2.0.1"
version = "2.0.2"
description = "Simple and fast osu! API v1 and v2 library"
authors = ["Nice Aesthetics <[email protected]>"]
license = "GPLv3+"
Expand Down

0 comments on commit 712c441

Please sign in to comment.