Skip to content

Commit

Permalink
fix(server): load processing level as string in external stac collect…
Browse files Browse the repository at this point in the history
…ion (#1429)
  • Loading branch information
alambare authored Dec 18, 2024
1 parent 076a0f8 commit 90f0545
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eodag/rest/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,16 @@ def eodag_api_init() -> None:
constellation: Union[str, List[str]] = ext_col.get("summaries", {}).get(
"constellation"
)
processing_level: Union[str, List[str]] = ext_col.get("summaries", {}).get(
"processing:level"
)
# Check if platform or constellation are lists and join them into a string if they are
if isinstance(platform, list):
platform = ",".join(platform)
if isinstance(constellation, list):
constellation = ",".join(constellation)
if isinstance(processing_level, list):
processing_level = ",".join(processing_level)

update_fields = {
"title": ext_col.get("title"),
Expand All @@ -741,7 +746,7 @@ def eodag_api_init() -> None:
),
"platform": constellation,
"platformSerialIdentifier": platform,
"processingLevel": ext_col.get("summaries", {}).get("processing:level"),
"processingLevel": processing_level,
"license": ext_col["license"],
"missionStartDate": ext_col["extent"]["temporal"]["interval"][0][0],
"missionEndDate": ext_col["extent"]["temporal"]["interval"][-1][1],
Expand Down

0 comments on commit 90f0545

Please sign in to comment.