Skip to content

Commit

Permalink
fix: orderLink in build_search plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato committed Apr 3, 2024
1 parent ac53539 commit 0909b48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions eodag/plugins/search/build_search_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import geojson
import orjson
from jsonpath_ng import Fields
from jsonpath_ng import Child, Fields, Root

from eodag.api.product import EOProduct
from eodag.api.product.metadata_mapping import properties_from_json
Expand Down Expand Up @@ -171,8 +171,10 @@ def normalize_results(
parsed_properties["_dc_qs"] = quote_plus(qs)

# parse metadata needing downloadLink
dl_path = Fields("downloadLink")
dl_path_from_root = Child(Root(), dl_path)
for param, mapping in self.config.metadata_mapping.items():
if Fields("downloadLink") in mapping:
if dl_path in mapping or dl_path_from_root in mapping:
parsed_properties.update(
properties_from_json(parsed_properties, {param: mapping})
)
Expand Down
3 changes: 2 additions & 1 deletion eodag/resources/providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2632,6 +2632,7 @@
# storageStatus set to ONLINE for consistency between providers
storageStatus: '{$.null#replace_str("Not Available","ONLINE")}'
downloadLink: 'https://cds.climate.copernicus.eu/cdsapp#!/dataset/{dataset}'
orderLink: '$.downloadLink'
# Copernicus CDS specific parameters
accuracy:
- accuracy
Expand Down Expand Up @@ -3510,7 +3511,7 @@
timeIntervalsAlignment:
- '{{"timeIntervalsAlignment": {timeIntervalsAlignment#to_geojson} }}'
- '$.timeIntervalsAlignment'
orderLink: '{downloadLink#replace_str(r"^(.*)(\")(queries\")(.)",r"\1\2runOnJobQueue\2\4 true, \2\3\4")}'
orderLink: '{$.downloadLink#replace_str(r"^(.*)(\")(queries\")(.)",r"\1\2runOnJobQueue\2\4 true, \2\3\4")}'
products:
NEMSGLOBAL_TCDC:
queries: [{'domain':'NEMSGLOBAL','gapFillDomain':null,'timeResolution':'daily','codes':[{'code':71,'level':'sfc','aggregation':'mean'}]}]
Expand Down

0 comments on commit 0909b48

Please sign in to comment.