Spaces:
Sleeping
Sleeping
Upload main.py
Browse files269 unmodified lines27027127227327427526 unmodified lines302303304305306307424 unmodified lines732733734735736737269 unmodified linesdef process_sheet_data(values): # For Value Categoriesif 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, '')}processed_data.append(processed_item)return processed_data424 unmodified linescategory_changes_for_api.append(change_info)change_detected_for_webhook = Truechange_info_webhook = change_info # Store last change for potential webhook# Prepare webhook only if a change was found AND cache was readyif change_detected_for_webhook and cache["is_ready"] and VALUE_WEBHOOK_URL:269 unmodified lines27027127227327427527626 unmodified lines303304305306307308309424 unmodified lines734735736737738739740741742743744269 unmodified linesdef process_sheet_data(values): # For Value Categoriesif 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 linescategory_changes_for_api.append(change_info)change_detected_for_webhook = Truechange_info_webhook = change_info # Store last change for potential webhook# Add lastUpdated field to new_item when changes detectednew_item['lastUpdated'] = timestamp_isoelse:# This is a new item, add lastUpdated fieldnew_item['lastUpdated'] = timestamp_iso# Prepare webhook only if a change was found AND cache was readyif change_detected_for_webhook and cache["is_ready"] and VALUE_WEBHOOK_URL:
main.py+7