This commit is contained in:
zman 2025-04-04 15:31:06 -04:00
parent 45c589d225
commit c9b57f00ea
2 changed files with 3 additions and 9 deletions

View File

@ -94,7 +94,7 @@ class PricingService:
def cron_load_prices(self, file: File = None):
file_content = self.get_pricing_export_content(file)
self.tcgplayer_service.load_tcgplayer_cards(file)
self.tcgplayer_service.load_tcgplayer_cards(file_content)
self.load_pricing_csv_content_to_db(file_content)
def get_all_prices_for_products(self, product_ids: List[str]) -> Dict[str, Dict[str, float]]:

View File

@ -499,16 +499,10 @@ class TCGPlayerService:
except SQLAlchemyError as e:
raise RuntimeError(f"Failed to retrieve group IDs: {str(e)}")
def load_tcgplayer_cards(self) -> File:
def load_tcgplayer_cards(self, file_content):
try:
# Get pricing export
export_csv_file = self.get_pricing_export_for_all_products()
export_csv = self.file_service.get_file_content(export_csv_file.id)
# load to card tcgplayer
self.load_export_csv_to_card_tcgplayer(export_csv, export_csv_file.id)
return export_csv_file
self.load_export_csv_to_card_tcgplayer(file_content)
except Exception as e:
logger.error(f"Failed to load prices: {e}")