diff --git a/metadata_mapper/mappers/oai/content_dm/contentdm_mapper.py b/metadata_mapper/mappers/oai/content_dm/contentdm_mapper.py index bb6a5dc90..959f4d0e8 100644 --- a/metadata_mapper/mappers/oai/content_dm/contentdm_mapper.py +++ b/metadata_mapper/mappers/oai/content_dm/contentdm_mapper.py @@ -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() @@ -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