misc fixes
This commit is contained in:
1 parent
9804b6d673
commit
fb908e00b7
2 files changed
+16
-4
No files matched your search
+2
-1
@@ -53,7 +53,7 @@ class AsyncBricksetAPI:
|
||||
self.logger.info("Successfully authenticated with Brickset API")
|
||||
return result
|
||||
|
||||
async def get_set(self, set_number: str) -> Dict[str, Any]:
|
||||
async def get_set(self, set_number: int) -> Dict[str, Any]:
|
||||
"""
|
||||
Fetch LEGO set information asynchronously
|
||||
|
||||
@@ -72,6 +72,7 @@ class AsyncBricksetAPI:
|
||||
"userHash": self.user_hash,
|
||||
"params": json.dumps({"setNumber": f"{set_number}-1"}),
|
||||
}
|
||||
print(f"[@DEBUG] {params}...")
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get(
|
||||
|
||||
+14
-3
@@ -11,8 +11,8 @@ import re
|
||||
import logging
|
||||
from logging.handlers import RotatingFileHandler
|
||||
from pathlib import Path
|
||||
print("Creating log directory if it doesn't exist...")
|
||||
Path("./logs/").mkdir(parents=True, exist_ok=True)
|
||||
#print("Creating log directory if it doesn't exist...")
|
||||
#Path("./logs/").mkdir(parents=True, exist_ok=True)
|
||||
|
||||
import banner
|
||||
import get_sq_env
|
||||
@@ -47,7 +47,18 @@ UA = re.compile(r"^kopling\/?", re.IGNORECASE)
|
||||
|
||||
async def run_update():
|
||||
set_list = await sq.acat2id(SQUARE_LEGO_CAT_ID)
|
||||
print(f"[@DEBUG]\t {set_list}") # type: ignore
|
||||
#print(f"[@DEBUG]\t {set_list}") # type: ignore
|
||||
for l_set in set_list:
|
||||
#print(f"[@DEBUG]{l_set}")
|
||||
try:
|
||||
l_setinfo = await lego.throttled_get_set(l_set["number"])
|
||||
print(f"[@DEBUG] Found {l_setinfo["pw_name"]}")
|
||||
except Exception as e:
|
||||
print(f"Error fetching set\t: {l_set}: {str(e)}")
|
||||
continue
|
||||
|
||||
#print(f"[@DEBUG]{l_setinfo}")
|
||||
#await sq.update_itm(l_set, l_setinfo)
|
||||
"""for l_set in set_list:
|
||||
print(f"[@DEBUG]{l_set}")
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user