Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor: cleaner code
Co-authored-by: Christian Clauss <[email protected]>
  • Loading branch information
NumberPigeon and cclauss authored Aug 30, 2023
commit 77a82cb77f4a2515f6ba0160f7c982146a993d06
10 changes: 2 additions & 8 deletions sc2reader/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,8 @@ def __init__(self, uid, init_data):
#: 2. The user has a None value for their 'scaled_rating' key, or
#: 3. The user has a negative rating, often -36400.
#: For ease of use, this property will return None in both cases.
if (
"scaled_rating" in init_data
and init_data["scaled_rating"] is not None
and init_data["scaled_rating"] > 0
):
self.mmr = init_data["scaled_rating"]
else:
self.mmr = None
mmr = int(init_data.get("scaled_rating") or 0)
self.mmr = mmr if mmr > 0 else None

@property
def url(self):
Expand Down