Skip to content

Commit

Permalink
Merge pull request #277 from datalad/translator-edits
Browse files Browse the repository at this point in the history
ENH: Translator edits
  • Loading branch information
jsheunis authored Apr 13, 2023
2 parents 812a2fb + 6cab262 commit 78592ee
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion datalad_catalog/translators/bids_dataset_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,19 @@ def get_name(self):
return self.extracted_metadata.get("title", "")

def get_description(self):
return self.extracted_metadata.get("description")
bids_description = self.extracted_metadata.get("description")
if isinstance(bids_description, str):
return bids_description
elif isinstance(bids_description, list):
if len(bids_description) > 0:
# bids_description expected format = [{"extension": "", "text": "",}]
# TODO: figure out which extension has priority;
# take 1st element for now
return bids_description[0].get("text", None)
else:
return None
else:
return None

def get_license(self):
program = '.license | { "name": .name, "url": ""}'
Expand Down

0 comments on commit 78592ee

Please sign in to comment.