mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2026-03-07 22:22:34 +01:00
fix: delete stale raw parquet before auto-refresh (#53)
* 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. * docs: update changelog and release notes for stale data fix
This commit is contained in:
parent
65680fb920
commit
fa8f60035b
3 changed files with 17 additions and 0 deletions
|
|
@ -1417,6 +1417,16 @@ def _ensure_setup_ready(out, force: bool = False) -> None:
|
|||
|
||||
try:
|
||||
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
|
||||
initial_setup()
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue