Skip to content

Commit

Permalink
update is_bytes_representation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Sep 8, 2024
1 parent 4b4df07 commit 4de9777
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/atproto_client/models/blob_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BlobRef(BaseModel):
@property
def cid(self) -> 'CID':
"""Get CID."""
if isinstance(self.ref, (str, bytes)):
if self.is_bytes_representation:
return CID.decode(self.ref)

return CID.decode(self.ref.link)
Expand All @@ -48,7 +48,7 @@ def is_bytes_representation(self) -> bool:
Returns:
True if it is bytes representation.
"""
return isinstance(self.ref, str)
return isinstance(self.ref, (str, bytes))

def to_json_representation(self) -> 'BlobRef':
"""Get JSON representation.
Expand Down

0 comments on commit 4de9777

Please sign in to comment.