Skip to content

Commit 8a0547e

Browse files
committed
fix: cop_dem items download for wekeo_main
1 parent 2e6ac19 commit 8a0547e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

eodag/api/core.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,20 +1549,20 @@ def _search_by_id(
15491549
**kwargs,
15501550
):
15511551
results.data.extend(page_results.data)
1552+
# try using crunch to get unique result and stop if found, to avoid unnecessary requests
1553+
if (
1554+
len(results) > 1
1555+
and len(filtered := results.filter_property(id=uid)) == 1
1556+
):
1557+
results = filtered
1558+
break
15521559
except Exception as e:
15531560
if kwargs.get("raise_errors"):
15541561
raise
15551562
logger.warning(e)
15561563
results.errors.append((plugin.provider, e))
15571564
continue
15581565

1559-
# try using crunch to get unique result
1560-
if (
1561-
len(results) > 1
1562-
and len(filtered := results.filter_property(id=uid)) == 1
1563-
):
1564-
results = filtered
1565-
15661566
if len(results) == 1:
15671567
if not results[0].collection:
15681568
# guess collection from properties

0 commit comments

Comments
 (0)