Skip to content

Commit e2e2a56

Browse files
committed
fix(item): gate downloadLink creation on online order status
1 parent 2aa22b8 commit e2e2a56

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

stac_fastapi/eodag/models/item.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ def create_stac_item(
9999
if origin:
100100
asset["alternate"] = {"origin": origin}
101101

102+
is_product_online = (
103+
properties.get("order:status", ONLINE_STATUS) == ONLINE_STATUS or provider in auto_order_whitelist
104+
)
105+
102106
# TODO: remove downloadLink asset after EODAG assets rework
103-
if not any(asset_name.endswith(".parquet") for asset_name in assets):
107+
if is_product_online and not any(asset_name.endswith(".parquet") for asset_name in assets):
104108
# eodag:download_link may be missing for some providers (e.g. planetary_computer)
105109
# but we still want to provide a download link for them when proxying is enabled.
106110
origin_href = properties.get("eodag:download_link")
@@ -112,7 +116,7 @@ def create_stac_item(
112116

113117
if download_link:
114118
assets["downloadLink"] = {
115-
"title": "Download link",
119+
"title": "Full product download link",
116120
"href": download_link,
117121
"type": mime_type,
118122
"roles": ["data"],

0 commit comments

Comments
 (0)