Skip to content

Commit

Permalink
Map is_shown_by even if record has no type
Browse files Browse the repository at this point in the history
  • Loading branch information
barbarahui committed Oct 11, 2024
1 parent a46d483 commit 3ebea69
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions metadata_mapper/mappers/oai/content_dm/contentdm_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ def map_is_shown_by(self):
To run post mapping. For this one, is_shown_by needs sourceResource/type
"""
record_type = self.map_type()
if not record_type:
return

record_types = [record_type] if isinstance(record_type, str) else record_type

if "sound" in [t.lower() for t in record_types]:
return None
if record_type:
record_types = [record_type] if isinstance(record_type, str) else record_type
if "sound" in [t.lower() for t in record_types]:
return None

return self.get_preview_image_url()

Expand Down Expand Up @@ -71,6 +69,7 @@ def get_preview_image_url(self):
feed's object_id, but larger images are sometimes available.
"""
larger_preview_image = self.get_larger_preview_image_url()

if larger_preview_image:
return larger_preview_image

Expand Down

0 comments on commit 3ebea69

Please sign in to comment.