Skip to content
Open
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
11 changes: 6 additions & 5 deletions app/models/clans.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"any",
]
ClanType = Literal["open", "inviteOnly", "closed"]
BattleModifier = Literal["NONE", "HARD_MODE", "MINUS_ONE", "MINUS_TWO", "MINUS_THREE"]


class ClanMember(ApiModel):
Expand Down Expand Up @@ -137,7 +138,7 @@ class ClanWarAttack(ApiModel):
stars: int
destructionPercentage: int
order: int
duration: int | None = None
duration: int


class ClanWarMember(ApiModel):
Expand All @@ -151,8 +152,8 @@ class ClanWarMember(ApiModel):


class WarClan(ApiModel):
tag: str
name: str
tag: str | None = None
name: str | None = None
badgeUrls: BadgeUrls | None = None
clanLevel: int
attacks: int | None = None
Expand All @@ -166,7 +167,7 @@ class ClanWar(ApiModel):
state: str
teamSize: int | None = None
attacksPerMember: int | None = None
battleModifier: str | None = None
battleModifier: BattleModifier | None = None
preparationStartTime: str | None = None
startTime: str | None = None
endTime: str | None = None
Expand All @@ -179,7 +180,7 @@ class ClanWarLogEntry(ApiModel):
endTime: str
teamSize: int
attacksPerMember: int | None = None
battleModifier: str | None = None
battleModifier: BattleModifier | None = None
clan: WarClan
opponent: WarClan

Expand Down
8 changes: 6 additions & 2 deletions app/models/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@ class Player(ApiModel):


class BattleLogEntry(ApiModel):
battleType: Literal["ranked", "legend", "homeVillage"]
battleType: Literal["HOME_VILLAGE", "RANKED", "LEGEND"]
attack: bool
armyShareCode: str | None = None
opponentPlayerTag: str
opponentName: str
opponentTownHallLevel: int
stars: int
destructionPercentage: int
lootedResources: list[Resource] = Field(default_factory=list)
extraLootedResources: list[Resource] = Field(default_factory=list)
availableLoot: list[Resource] = Field(default_factory=list)
battleTime: int
battleTimestamp: str


class BattleLogResponse(ItemsResponse[BattleLogEntry]):
Expand All @@ -77,7 +81,7 @@ class PlayerRanking(ApiModel):
name: str
expLevel: int
rank: int
previousRank: int
previousRank: int | None = None
trophies: int
attackWins: int | None = None
defenseWins: int | None = None
Expand Down
17 changes: 9 additions & 8 deletions data/clans/currentwar/INWAR.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"members": [
{
"tag": "#2PRU8RPCP",
"name": "\u2b50\ufe0fsncmaxi\u2b50\ufe0f",
"name": "⭐️sncmaxi⭐️",
"townhallLevel": 12,
"mapPosition": 1,
"attacks": [
Expand Down Expand Up @@ -96,7 +96,7 @@
},
{
"tag": "#P0C9UJLPP",
"name": "YoSoyGod\u2764\ufe0f\u1d40\u1d34\u00b9\u00b2\u2081",
"name": "YoSoyGod❤️ᵀᴴ¹²₁",
"townhallLevel": 12,
"mapPosition": 3,
"attacks": [
Expand Down Expand Up @@ -148,7 +148,7 @@
},
"opponent": {
"tag": "#2QCVRQCQR",
"name": "\u2122 Galaxy",
"name": " Galaxy",
"badgeUrls": {
"small": "https://api-assets.clashofclans.com/badges/70/AEaHm0FmstsRRGTqajAhcz1Mi7ceR2ys7g5PL7p2mvk.png",
"large": "https://api-assets.clashofclans.com/badges/512/AEaHm0FmstsRRGTqajAhcz1Mi7ceR2ys7g5PL7p2mvk.png",
Expand All @@ -161,7 +161,7 @@
"members": [
{
"tag": "#9R08QRUU2",
"name": "\u767c\uff2e\uff29\uff34\uff29\uff33\uff28\u2757",
"name": "發NITISH❗",
"townhallLevel": 12,
"mapPosition": 1,
"attacks": [
Expand Down Expand Up @@ -236,7 +236,7 @@
},
{
"tag": "#PLGGC0L02",
"name": "\uff2b\u5de5\u3057\u3057\u30e2\u5c3a \u30e0",
"name": "K工ししモ尺 ム",
"townhallLevel": 12,
"mapPosition": 5,
"attacks": [
Expand All @@ -261,7 +261,7 @@
},
{
"tag": "#28R9YGPLP",
"name": "\uff27\uff28\uff2f\uff33\uff34\u00a0\uff26\uff32\uff25\uff21\uff2b",
"name": "GHOST FREAK",
"townhallLevel": 12,
"mapPosition": 4,
"attacks": [
Expand All @@ -285,11 +285,12 @@
}
}
]
}
},
"battleModifier": "MINUS_ONE"
},
"headers": {
"cache-control": "max-age=120",
"content-type": "application/json; charset=utf-8"
},
"response_code": 200
}
}
3 changes: 1 addition & 2 deletions data/clans/leaguegroup/ENDED.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"body": {
"state": "ended",
"season": "2023-09",
"season": "2023-09-01",
"clans": [
{
"tag": "#2PP",
Expand Down Expand Up @@ -805,4 +805,3 @@
},
"response_code": 200
}

4 changes: 2 additions & 2 deletions data/clans/leaguegroup/INWAR.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"body": {
"state": "inWar",
"season": "2023-06",
"season": "2023-06-02",
"clans": [
{
"tag": "#2PP",
Expand Down Expand Up @@ -1909,4 +1909,4 @@
"content-type": "application/json; charset=utf-8"
},
"response_code": 200
}
}
Loading