Skip to content

Commit cbde1dd

Browse files
Fix ingesting of images from adidas paginated pages
1 parent 3656896 commit cbde1dd

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

  • src/solesearch_api/tasks/scraping/retail/adidas

src/solesearch_api/tasks/scraping/retail/adidas/base.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,13 @@ def json_to_sneakers(self, data: dict) -> list[Sneaker] | None:
104104
)
105105
sneaker.sneaker_links.append(sneaker_link)
106106

107-
for index, image in enumerate(data.get("images", [])):
108-
image_url = re.sub(r"images/[^/]+/", "images/", image.get("src"))
109-
position = image.get("metadata", {}).get("sortOrder")
110-
position = int(position) if position else index
111-
image = Image(
112-
platform=Platform.RETAIL,
113-
position=position,
114-
url=image_url,
115-
)
116-
sneaker.sneaker_images.append(image)
107+
image_url = re.sub(r"images/[^/]+/", "images/", data.get("image"))
108+
image = Image(
109+
platform=Platform.RETAIL,
110+
position=0,
111+
url=image_url,
112+
)
113+
sneaker.sneaker_images.append(image)
117114

118115
sneakers.append(sneaker)
119116

0 commit comments

Comments
 (0)