Skip to content

Commit

Permalink
Use proper syntax for checking if key is in dict
Browse files Browse the repository at this point in the history
  • Loading branch information
syeopite committed Feb 19, 2025
1 parent a2bebb9 commit 3166b7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/priviblur_extractor/parse/collection_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, target) -> None:

@classmethod
def process(cls, initial_data):
if initial_data.get("blog"):
if "blog" in initial_data:
return cls(initial_data).parse()
else:
return None
Expand Down Expand Up @@ -125,9 +125,9 @@ def __init__(self, target) -> None:

@classmethod
def process(cls, initial_data):
if initial_data.get("timeline"):
if "timeline" in initial_data:
return cls(initial_data).parse()
elif initial_data.get("notes"):
elif "notes" in initial_data:
return cls(initial_data).parse_note_sequence()
else:
return None
Expand Down
2 changes: 1 addition & 1 deletion src/priviblur_extractor/parse/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def process(cls, initial_data):
if initial_data.get("type") == "reblog":
# If blog data isn't given under a blog object then
# the note is likely a simple reblog note
if initial_data.get("blogName"):
if "blogName" in initial_data:
return cls(initial_data).parse_simple()
return cls(initial_data).parse()

Expand Down

0 comments on commit 3166b7a

Please sign in to comment.