File tree Expand file tree Collapse file tree
src/solesearch_api/tasks/scraping/retail/adidas Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments