Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions albion_dps/qt/loot_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ def _apply_price_results(self, records: object, source: str) -> None:
return
rows = records if isinstance(records, list) else []
index = {
(
_quote_key(
str(row.get("item_id") or ""),
str(row.get("city") or ""),
int(row.get("quality") or 1),
Expand All @@ -1014,7 +1014,7 @@ def _apply_price_results(self, records: object, source: str) -> None:
if not item_id or bool(row.get("is_silver")):
continue
quality = int(row.get("quality") or 1)
quote = index.get((item_id, self._price_city, quality))
quote = index.get(_quote_key(item_id, self._price_city, quality))
if quote is None:
continue
self._session_store.upsert_valuation(
Expand Down Expand Up @@ -1263,6 +1263,10 @@ def _prompt_file_path_tk(
pass


def _quote_key(item_id: str, city: str, quality: int) -> tuple[str, str, int]:
return (item_id, city.casefold(), quality)


def _tk_filetypes(file_filter: str) -> list[tuple[str, str]]:
filetypes: list[tuple[str, str]] = []
raw = str(file_filter or "").strip()
Expand Down
10 changes: 5 additions & 5 deletions albion_dps/qt/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
SessionActivityEvent,
load_item_resolver,
)
from albion_dps.domain.item_db import ensure_game_databases
from albion_dps.domain.item_db import DATA_DIR, ensure_game_databases
from albion_dps.domain.loot_session_store import LootSessionStore
from albion_dps.domain.map_resolver import load_map_resolver
from albion_dps.market.local_ingest import MarketWebSocketIngestor
Expand Down Expand Up @@ -191,11 +191,11 @@ class _UpdateNotifier(QObject):
state.updateAutoCheckToggled.connect(_save_update_preference)
state.manualUpdateCheckRequested.connect(lambda: _start_update_check(update_notifier))
scanner_state = ScannerState(app_mode=args.qt_command)
market_cache_path = Path("data") / "market_cache.sqlite3"
market_cache_path = DATA_DIR / "market_cache.sqlite3"
market_cache_path.parent.mkdir(parents=True, exist_ok=True)
market_price_store = LocalMarketPriceStore(Path("data") / "market_prices.sqlite3")
market_price_store = LocalMarketPriceStore(DATA_DIR / "market_prices.sqlite3")
market_price_store.clear_old_quotes()
local_market_store = LocalMarketStore(Path("data") / "local_market.sqlite3")
local_market_store = LocalMarketStore(DATA_DIR / "local_market.sqlite3")
local_market_ingestor = MarketWebSocketIngestor(
store=local_market_store,
logger=logging.getLogger(__name__),
Expand All @@ -222,7 +222,7 @@ class _UpdateNotifier(QObject):
logger=logging.getLogger(__name__),
)
app_settings = load_app_settings()
loot_session_store = LootSessionStore(Path("data") / "loot_sessions.sqlite3")
loot_session_store = LootSessionStore(DATA_DIR / "loot_sessions.sqlite3")
loot_state = LootState(
history_limit=max(args.history, LOOT_HISTORY_LIMIT),
session_store=loot_session_store,
Expand Down
1 change: 1 addition & 0 deletions tools/extract_items/run_extract_items.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ fi

BUILD_PROPS=()
OBJ_DIR="$REPO_ROOT/tools/extract_items/obj"
mkdir -p "$OBJ_DIR" 2>/dev/null || true
if [[ ! -w "$OBJ_DIR" ]]; then
INTERMEDIATE_ROOT="${EXTRACT_ITEMS_INTERMEDIATE:-/tmp/extract_items_obj}"
OUTPUT_ROOT="${EXTRACT_ITEMS_OUTPUT:-/tmp/extract_items_bin}"
Expand Down