Skip to content

Commit

Permalink
fix: type checking vortex
Browse files Browse the repository at this point in the history
  • Loading branch information
MalikAza committed Jul 23, 2024
1 parent fa5924b commit a7bff09
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pyZUnivers/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,28 @@ def invocations_before_pity(self) -> int:

@property
def vortex_name(self) -> str:
if self.__vortex_stats == Vortex:
if isinstance(self.__vortex_stats, Vortex):
return self.__vortex_stats.name

return self.__vortex_stats['towerName']

@property
def vortex_begin_date(self) -> datetime:
if self.__vortex_stats == Vortex:
if isinstance(self.__vortex_stats, Vortex):
return self.__vortex_stats.begin_date

return datetime.strptime(self.__vortex_stats['towerSeasonBeginDate'], DATE_FORMAT)

@property
def vortex_end_date(self) -> datetime:
if self.__vortex_stats == Vortex:
if isinstance(self.__vortex_stats, Vortex):
return self.__vortex_stats.end_date

return datetime.strptime(self.__vortex_stats['towerSeasonEndDate'], DATE_FORMAT)

@property
def vortex_floor(self) -> int:
if self.__vortex_stats == Vortex or not self.__vortex_stats['maxFloorIndex']:
if isinstance(self.__vortex_stats, Vortex) or not self.__vortex_stats['maxFloorIndex']:
return 0

if self.__vortex_stats['maxFloorIndex'] == 0:
Expand All @@ -73,7 +73,7 @@ def vortex_floor(self) -> int:

@property
def vortex_tries(self) -> int:
if self.__vortex_stats == Vortex:
if isinstance(self.__vortex_stats, Vortex):
return 0

return self.__vortex_stats['towerLogCount']

0 comments on commit a7bff09

Please sign in to comment.