Skip to content

Commit

Permalink
Keep OAI map_type equal to legacy map_type
Browse files Browse the repository at this point in the history
  • Loading branch information
amywieliczka committed Dec 20, 2023
1 parent e0e51d2 commit 54bdcfa
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions metadata_mapper/mappers/oai/oai_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,19 @@ def map_type(self) -> list:
if isinstance(types, str):
types = [types]

type_list = []
for t in types:
mapped_type = None
for (type_k, type_v) in self.TYPES.items():
if mapped_type:
break
if t == f"{self.TYPES_BASEURL}{type_k}":
mapped_type = type_v
if not mapped_type:
mapped_type = t.replace(self.TYPES_BASEURL, "")
type_list.append(mapped_type.lower())
return type_list
return types
# type_list = []
# for t in types:
# mapped_type = None
# for (type_k, type_v) in self.TYPES.items():
# if mapped_type:
# break
# if t == f"{self.TYPES_BASEURL}{type_k}":
# mapped_type = type_v
# if not mapped_type:
# mapped_type = t.replace(self.TYPES_BASEURL, "")
# type_list.append(mapped_type.lower())
# return type_list


class OaiVernacular(Vernacular):
Expand Down

0 comments on commit 54bdcfa

Please sign in to comment.