diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 44cd264..c3daca9 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -14,7 +14,8 @@ "Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); print\\(''''Last sync:'''', d[''''last_sync'''']\\); print\\(''''Products:'''', len\\(d[''''products'''']\\)\\); print\\(''''Sample names:''''\\); [print\\('''' -'''', p[''''name''''][:80]\\) for p in d[''''products''''][:5]]\")", "Bash(PYTHON=\"/c/Users/hocke/Documents/GitHub/pokemon-stock-checker/.venv/Scripts/python.exe\")", "Bash(\"$PYTHON\" -c \":*)", - "Bash(1 grep:*)" + "Bash(1 grep:*)", + "Bash(taskkill /F /IM python.exe)" ] } } diff --git a/config.py b/config.py index 98f0bf5..7581fb2 100644 --- a/config.py +++ b/config.py @@ -36,7 +36,7 @@ SORT_BY_NEWEST = True # Which sites to monitor # Note: PokemonCenter has strong bot protection (Imperva) - may need manual workarounds # Note: Walmart has aggressive bot protection (PerimeterX) - may need stealth mode -SITES_ENABLED = ["target", "gamestop"] # Options: "pokemoncenter", "target", "gamestop", "bestbuy" (disabled - needs rework), "walmart" +SITES_ENABLED = ["target", "gamestop", "bestbuy"] # Options: "pokemoncenter", "target", "gamestop", "bestbuy" (disabled - needs rework), "walmart" # PokemonCenter URLs to monitor POKEMON_CENTER_URLS = [ diff --git a/dashboard/static/app.js b/dashboard/static/app.js index 95f8611..a1be244 100644 --- a/dashboard/static/app.js +++ b/dashboard/static/app.js @@ -6,6 +6,8 @@ const API_BASE = '/api'; let currentPage = 'dashboard'; let charts = {}; let currentEventFilter = null; // { type: 'new_drop'|'restock', period: 'today'|'week' } +let currentProductPage = 1; +const PRODUCTS_PER_PAGE = 50; // Initialize document.addEventListener('DOMContentLoaded', () => { @@ -81,6 +83,7 @@ function initEventListeners() { if (el) { el.addEventListener('change', () => { currentEventFilter = null; // Clear event filter when using regular filters + currentProductPage = 1; loadProducts(); }); } @@ -106,6 +109,7 @@ function clearAllFilters() { document.getElementById('filterStock').value = ''; document.getElementById('filterFavorites').checked = false; currentEventFilter = null; + currentProductPage = 1; loadProducts(); } @@ -296,12 +300,14 @@ async function loadActivityFeed() { // Navigate to products filtered by event type function goToFilteredProducts(eventType, period) { currentEventFilter = { type: eventType, period: period }; + currentProductPage = 1; navigateTo('products'); } // Clear event filter function clearEventFilter() { currentEventFilter = null; + currentProductPage = 1; loadProducts(); } @@ -311,8 +317,9 @@ async function loadProducts() { const category = document.getElementById('filterCategory')?.value || ''; const inStock = document.getElementById('filterStock')?.value || ''; const favoritesOnly = document.getElementById('filterFavorites')?.checked || false; + const offset = (currentProductPage - 1) * PRODUCTS_PER_PAGE; - let url = '/products?limit=50'; + let url = `/products?limit=${PRODUCTS_PER_PAGE}&offset=${offset}`; if (site) url += `&site=${site}`; if (category) url += `&category=${encodeURIComponent(category)}`; if (inStock) url += `&in_stock=${inStock}`; @@ -333,6 +340,7 @@ async function loadProducts() { if (data.products.length === 0) { grid.innerHTML = '