mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2026-03-24 22:16:31 +01:00
fix: delete stale raw parquet before auto-refresh
When auto-refresh triggers, remove cached raw file to ensure fresh MTGJSON download instead of reprocessing old data.
This commit is contained in:
parent
65680fb920
commit
41f035dae0
1 changed files with 10 additions and 0 deletions
|
|
@ -1417,6 +1417,16 @@ def _ensure_setup_ready(out, force: bool = False) -> None:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from file_setup.setup import initial_setup
|
from file_setup.setup import initial_setup
|
||||||
|
from path_util import card_files_raw_dir
|
||||||
|
# Delete stale raw file to force fresh download from MTGJSON
|
||||||
|
# This ensures we get the latest card data (e.g., new sets like ECL)
|
||||||
|
raw_cards_path = os.path.join(card_files_raw_dir(), "cards.parquet")
|
||||||
|
if os.path.exists(raw_cards_path):
|
||||||
|
try:
|
||||||
|
os.remove(raw_cards_path)
|
||||||
|
out(f"Removed stale raw file: {raw_cards_path}")
|
||||||
|
except Exception as e:
|
||||||
|
out(f"Warning: Could not remove stale raw file: {e}")
|
||||||
# Always run initial_setup when forced or when cards are missing/stale
|
# Always run initial_setup when forced or when cards are missing/stale
|
||||||
initial_setup()
|
initial_setup()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue