fix: added default product image, removed empty tables prints, fixed barcode output
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import asyncio
|
||||
import base64
|
||||
from typing import List, Tuple
|
||||
from typing import List, Tuple, Optional
|
||||
|
||||
import aiohttp
|
||||
|
||||
|
||||
async def fetch_image(url: str) -> str:
|
||||
async def fetch_image(url: Optional[str]) -> str:
|
||||
if not url:
|
||||
return ""
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(url) as response:
|
||||
if response.status == 200:
|
||||
@@ -15,6 +18,6 @@ async def fetch_image(url: str) -> str:
|
||||
return ""
|
||||
|
||||
|
||||
async def fetch_images(urls: List[str]) -> Tuple[str]:
|
||||
async def fetch_images(urls: List[Optional[str]]) -> Tuple[str]:
|
||||
tasks = [fetch_image(url) for url in urls]
|
||||
return await asyncio.gather(*tasks)
|
||||
|
||||
Reference in New Issue
Block a user