Skip to content

Commit

Permalink
removed default 0 from element_count
Browse files Browse the repository at this point in the history
It was causing the `element_count` to always be `0`, even when the key was defined
  • Loading branch information
emilywotruba committed Jun 9, 2024
1 parent a59fd65 commit f5193ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/simplejustwatchapi/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class Offer(NamedTuple):
url: str
"""URL to this offer."""

element_count: int
element_count: int | None
"""Element count, usually 0."""

available_to: str | None
Expand Down Expand Up @@ -502,7 +502,7 @@ def _parse_offer(json: any) -> Offer:
type = json.get("type")
package = _parse_package(json["package"])
url = json.get("standardWebURL")
element_count = json.get("elementCount", 0)
element_count = json.get("elementCount")
available_to = json.get("availableTo")
deeplink_roku = json.get("deeplinkRoku")
subtitle_languages = json.get("subtitleLanguages")
Expand Down

0 comments on commit f5193ff

Please sign in to comment.