Skip to content

Commit

Permalink
Fix thumbnail calls payload (#6)
Browse files Browse the repository at this point in the history
* Corrected request_thumbnail calls

See also shotgunsoftware#81

* Fixed missing entity for thumbnail_arrived singal_payload

See also shotgunsoftware#81
  • Loading branch information
Joe Yu authored Jun 2, 2020
1 parent e54da65 commit c30323d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/activity_stream/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,39 +464,42 @@ def request_activity_thumbnails(self, activity_id):
if entity.get("user.HumanUser.image") and self._sg_data_retriever:
uid = self._sg_data_retriever.request_thumbnail(
entity["user.HumanUser.image"],
entity["user"]["id"],
entity["user"]["type"],
entity["user"]["id"],
"image",
load_image=True,
)
self._thumb_map[uid] = {
"activity_id": activity_id,
"entity": entity,
"thumbnail_type": self.THUMBNAIL_CREATED_BY,
}

elif entity.get("user.ClientUser.image") and self._sg_data_retriever:
uid = self._sg_data_retriever.request_thumbnail(
entity["user.ClientUser.image"],
entity["user"]["id"],
entity["user"]["type"],
entity["user"]["id"],
"image",
load_image=True,
)
self._thumb_map[uid] = {
"activity_id": activity_id,
"entity": entity,
"thumbnail_type": self.THUMBNAIL_CREATED_BY,
}

elif entity.get("user.ApiUser.image") and self._sg_data_retriever:
uid = self._sg_data_retriever.request_thumbnail(
entity["user.ApiUser.image"],
entity["user"]["id"],
entity["user"]["type"],
entity["user"]["id"],
"image",
load_image=True,
)
self._thumb_map[uid] = {
"activity_id": activity_id,
"entity": entity,
"thumbnail_type": self.THUMBNAIL_CREATED_BY,
}

Expand All @@ -515,6 +518,7 @@ def request_activity_thumbnails(self, activity_id):
)
self._thumb_map[uid] = {
"activity_id": activity_id,
"entity": entity,
"thumbnail_type": self.THUMBNAIL_CREATED_BY,
}

Expand All @@ -526,6 +530,7 @@ def request_activity_thumbnails(self, activity_id):
)
self._thumb_map[uid] = {
"activity_id": activity_id,
"entity": entity,
"thumbnail_type": self.THUMBNAIL_ENTITY,
}

Expand Down

0 comments on commit c30323d

Please sign in to comment.