Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sections in heroes_comparisons of profile pages #167

Merged
merged 4 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
819 changes: 584 additions & 235 deletions app/common/api_examples.py

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions app/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,19 @@ class CareerHeroesComparisonsCategory(StrEnum):

TIME_PLAYED = "time_played"
GAMES_WON = "games_won"
WEAPON_ACCURACY = "weapon_accuracy"
WIN_PERCENTAGE = "win_percentage"
WEAPON_ACCURACY_BEST_IN_GAME = "weapon_accuracy_best_in_game"
ELIMINATIONS_PER_LIFE = "eliminations_per_life"
CRITICAL_HIT_ACCURACY = "critical_hit_accuracy"
KILL_STREAK_BEST = "kill_streak_best"
MULTIKILL_BEST = "multikill_best"
OBJECTIVE_KILLS = "objective_kills"
ELIMINATIONS_AVG_PER_10_MIN = "eliminations_avg_per_10_min"
DEATHS_AVG_PER_10_MIN = "deaths_avg_per_10_min"
FINAL_BLOWS_AVG_PER_10_MIN = "final_blows_avg_per_10_min"
SOLO_KILLS_AVG_PER_10_MIN = "solo_kills_avg_per_10_min"
OBJECTIVE_KILLS_AVG_PER_10_MIN = "objective_kills_avg_per_10_min"
OBJECTIVE_TIME_AVG_PER_10_MIN = "objective_time_avg_per_10_min"
HERO_DAMAGE_DONE_AVG_PER_10_MIN = "hero_damage_done_avg_per_10_min"
HEALING_DONE_AVG_PER_10_MIN = "healing_done_avg_per_10_min"


class RouteTag(StrEnum):
Expand Down
44 changes: 36 additions & 8 deletions app/models/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,29 +240,57 @@ class HeroesComparisons(BaseModel):
...,
description="Number of games won for each hero (integer)",
)
weapon_accuracy: HeroesStats | None = Field(
...,
description="Percentage of weapon accuracy for each hero (integer between 0 and 100)",
)
win_percentage: HeroesStats | None = Field(
...,
description="Winrate percentage for each hero (integer between 0 and 100)",
)
weapon_accuracy_best_in_game: HeroesStats | None = Field(
...,
description="Best weapon accuracy in game for each hero (integer percent between 0 and 100)",
)
eliminations_per_life: HeroesStats | None = Field(
...,
description="Eliminations per life for each hero (float)",
)
critical_hit_accuracy: HeroesStats | None = Field(
kill_streak_best: HeroesStats | None = Field(
...,
description="Critical hit accuracy percentage for each hero (integer between 0 and 100)",
description="Best kill streak in game for each hero (integer)",
)
multikill_best: HeroesStats | None = Field(
...,
description="Best multikills statistic for each hero (integer)",
)
objective_kills: HeroesStats | None = Field(
eliminations_avg_per_10_min: HeroesStats | None = Field(
...,
description="Average eliminations per 10 minutes for each hero (float)",
)
deaths_avg_per_10_min: HeroesStats | None = Field(
...,
description="Average deaths per 10 minutes for each hero (float)",
)
final_blows_avg_per_10_min: HeroesStats | None = Field(
...,
description="Average final blows per 10 minutes for each hero (float)",
)
solo_kills_avg_per_10_min: HeroesStats | None = Field(
...,
description="Average solo kills per 10 minutes for each hero (float)",
)
objective_kills_avg_per_10_min: HeroesStats | None = Field(
...,
description="Average objective kills per 10 minutes for each hero (float)",
)
objective_time_avg_per_10_min: HeroesStats | None = Field(
...,
description="Average objective time per 10 minutes for each hero in seconds (integer)",
)
hero_damage_done_avg_per_10_min: HeroesStats | None = Field(
...,
description="Average damage done per 10 minutes for each hero (integer)",
)
healing_done_avg_per_10_min: HeroesStats | None = Field(
...,
description="Total number of objective kills for each hero (integer)",
description="Average healing done per 10 minutes for each hero (integer)",
)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "overfast-api"
version = "2.32.1"
version = "2.33.0"
description = "Overwatch API giving data about heroes, maps, and players statistics."
license = "MIT"
authors = ["Valentin PORCHET <[email protected]>"]
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/html/home.html

Large diffs are not rendered by default.

36 changes: 21 additions & 15 deletions tests/fixtures/html/players/Dekk-2677.html

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions tests/fixtures/html/players/JohnV1-1190.html

Large diffs are not rendered by default.

36 changes: 21 additions & 15 deletions tests/fixtures/html/players/KIRIKO-21253.html

Large diffs are not rendered by default.

36 changes: 21 additions & 15 deletions tests/fixtures/html/players/Player-1112937.html

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions tests/fixtures/html/players/TeKrop-2217.html

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions tests/fixtures/html/players/Unknown-1234.html

Large diffs are not rendered by default.

21 changes: 14 additions & 7 deletions tests/fixtures/html/players/copypasting-1216.html

Large diffs are not rendered by default.

36 changes: 21 additions & 15 deletions tests/fixtures/html/players/quibble-11594.html

Large diffs are not rendered by default.

25 changes: 16 additions & 9 deletions tests/fixtures/html/search.html

Large diffs are not rendered by default.

Loading
Loading