Skip to content

Commit

Permalink
fix: typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
283375 committed Oct 2, 2024
1 parent 6e8ac3d commit 48562c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
38 changes: 20 additions & 18 deletions src/arcaea_offline/external/exporters/defv2/play_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@ class ArcaeaOfflineDEFv2PlayResultExporter:
def export(self, items: List[PlayResult]) -> ArcaeaOfflineDEFv2PlayResultRoot:
export_items = []
for item in items:
export_item: ArcaeaOfflineDEFv2PlayResultItem = {}
export_item: ArcaeaOfflineDEFv2PlayResultItem = {
"id": item.id,
"songId": item.song_id,
"ratingClass": item.rating_class.value,
"score": item.score,
"pure": item.pure,
"far": item.far,
"lost": item.lost,
"date": int(item.date.timestamp() * 1000) if item.date else 0,
"maxRecall": item.max_recall,
"modifier": (
item.modifier.value if item.modifier is not None else None
),
"clearType": (
item.clear_type.value if item.clear_type is not None else None
),
"source": "https://arcaeaoffline.sevive.xyz/python",
"comment": item.comment,
}

export_item["id"] = item.id
export_item["songId"] = item.song_id
export_item["ratingClass"] = item.rating_class.value
export_item["score"] = item.score
export_item["pure"] = item.pure
export_item["far"] = item.far
export_item["lost"] = item.lost
export_item["date"] = item.date
export_item["maxRecall"] = item.max_recall
export_item["modifier"] = (
item.modifier.value if item.modifier is not None else None
)
export_item["clearType"] = (
item.clear_type.value if item.clear_type is not None else None
)
export_item["source"] = "https://arcaeaoffline.sevive.xyz/python"
export_item["comment"] = item.comment
export_items.append(export_item)

return {
"$schema": "https://arcaeaoffline.sevive.xyz/schemas/def/v2/score.schema.json",
Expand Down
6 changes: 3 additions & 3 deletions src/arcaea_offline/external/importers/arcaea/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def parse(self) -> List[Union[Pack, PackLocalized]]:

if name_localized or description_localized:
pack_localized = PackLocalized(id=pack.id)
pack_localized.lang = key.value
pack_localized.lang = ArcaeaLanguage(key.value)
pack_localized.name = name_localized
pack_localized.description = description_localized
results.append(pack_localized)
Expand Down Expand Up @@ -96,7 +96,7 @@ def parse_songs(self) -> List[Union[Song, SongLocalized, SongSearchWord]]:

if title_localized or source_localized:
song_localized = SongLocalized(id=song.id)
song_localized.lang = lang.value
song_localized.lang = ArcaeaLanguage(lang.value)
song_localized.title = title_localized
song_localized.source = source_localized
results.append(song_localized)
Expand Down Expand Up @@ -167,7 +167,7 @@ def parse_difficulties(self) -> List[Union[Difficulty, DifficultyLocalized]]:
song_id=difficulty.song_id,
rating_class=difficulty.rating_class,
)
difficulty_localized.lang = lang.value
difficulty_localized.lang = ArcaeaLanguage(lang.value)
difficulty_localized.title = title_localized
difficulty_localized.artist = artist_localized
results.append(difficulty_localized)
Expand Down

0 comments on commit 48562c3

Please sign in to comment.