Spaces:
Sleeping
Sleeping
Upload main.py
Browse files309 unmodified lines310311312313314315316424 unmodified lines741742743744745746747748749750751309 unmodified lines# Add lastUpdated if it exists in the sheetif last_updated and str(last_updated).strip():processed_item['lastUpdated'] = str(last_updated).strip()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:309 unmodified lines310311312313314315316317318319320424 unmodified lines745746747748749750751752753309 unmodified lines# Add lastUpdated if it exists in the sheetif last_updated and str(last_updated).strip():# Only add if it's in the format yyyy-MM-dd HH:mm:sslast_updated_str = str(last_updated).strip()# Check if it matches the expected date formatif re.match(r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$', last_updated_str):processed_item['lastUpdated'] = last_updated_strprocessed_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 webhookelse:# This is a new item, but don't add lastUpdated field herepass# 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-5