Spaces:
Sleeping
Sleeping
Upload main.py
Browse files269 unmodified lines27027127227327427527626 unmodified lines303304305306307308309424 unmodified lines734735736737738739740741742743744269 unmodified linesdef process_sheet_data(values): # For Value Categories if not values: return [] processed_data = [] for row_idx, row in enumerate(values): # Start counting from sheet row 6 (index 0 here) if not row or not any(str(cell).strip() for cell in row if cell is not None): continue # Skip header-like rows (e.g., "LEVEL 1 | HYPERCHROMES" in column F/index 4)26 unmodified lines 'marketValue': format_currency(market_value_raw), 'demand': clean_string(demand, 'N/A'), 'notes': clean_string(notes, '') # Remove lastUpdated field - will only be set when an update is detected } processed_data.append(processed_item) return processed_data424 unmodified lines category_changes_for_api.append(change_info) change_detected_for_webhook = True change_info_webhook = change_info # Store last change for potential webhook # Add lastUpdated field to new_item when changes detected new_item['lastUpdated'] = timestamp_iso else: # This is a new item, add lastUpdated field new_item['lastUpdated'] = timestamp_iso
# Prepare webhook only if a change was found AND cache was ready if change_detected_for_webhook and cache["is_ready"] and VALUE_WEBHOOK_URL:main.py+7