Skip to content

Commit

Permalink
Merge pull request #824 from sickelap/set_motion_photo_type_for_list
Browse files Browse the repository at this point in the history
set motion_photo type for photo list where applicable
  • Loading branch information
derneuere committed Apr 15, 2023
2 parents 66d0800 + c40bf80 commit 447445d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/serializers/photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ def get_dominantColor(self, obj) -> str:
def get_type(self, obj) -> str:
if obj.video:
return "video"
else:
return "image"
if obj.main_file.embedded_media.count() > 0:
return "motion_photo"
return "image"


class GroupedPhotosSerializer(serializers.ModelSerializer):
Expand Down

0 comments on commit 447445d

Please sign in to comment.