Spaces:
Running
Running
Upload main.py
Browse files
main.py
CHANGED
|
@@ -61,7 +61,7 @@ CATEGORIES = [
|
|
| 61 |
"Vehicles", "Textures", "Colours", "Spoilers",
|
| 62 |
"Rims", "Furnitures", "Gun Skins", "Hyperchromes"
|
| 63 |
]
|
| 64 |
-
VALUES_RANGE = 'B6:
|
| 65 |
|
| 66 |
# Cache Update Interval
|
| 67 |
CACHE_UPDATE_INTERVAL_SECONDS = 60
|
|
@@ -288,6 +288,8 @@ def process_sheet_data(values): # For Value Categories
|
|
| 288 |
demand = row[10] if len(row) > 10 else 'N/A' # Column L
|
| 289 |
notes = row[12] if len(row) > 12 else '' # Column N
|
| 290 |
drive_url = row[14] if len(row) > 14 else None # Column P
|
|
|
|
|
|
|
| 291 |
|
| 292 |
cleaned_name = clean_string(name)
|
| 293 |
# Also skip if name is clearly a header like "Name"
|
|
@@ -305,6 +307,11 @@ def process_sheet_data(values): # For Value Categories
|
|
| 305 |
'notes': clean_string(notes, '')
|
| 306 |
# Remove lastUpdated field - will only be set when an update is detected
|
| 307 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 308 |
processed_data.append(processed_item)
|
| 309 |
return processed_data
|
| 310 |
|
|
|
|
| 61 |
"Vehicles", "Textures", "Colours", "Spoilers",
|
| 62 |
"Rims", "Furnitures", "Gun Skins", "Hyperchromes"
|
| 63 |
]
|
| 64 |
+
VALUES_RANGE = 'B6:R' # Range within each category sheet including column R for lastUpdated
|
| 65 |
|
| 66 |
# Cache Update Interval
|
| 67 |
CACHE_UPDATE_INTERVAL_SECONDS = 60
|
|
|
|
| 288 |
demand = row[10] if len(row) > 10 else 'N/A' # Column L
|
| 289 |
notes = row[12] if len(row) > 12 else '' # Column N
|
| 290 |
drive_url = row[14] if len(row) > 14 else None # Column P
|
| 291 |
+
# Extract lastUpdated from column R (index 16)
|
| 292 |
+
last_updated = row[16] if len(row) > 16 else None # Column R
|
| 293 |
|
| 294 |
cleaned_name = clean_string(name)
|
| 295 |
# Also skip if name is clearly a header like "Name"
|
|
|
|
| 307 |
'notes': clean_string(notes, '')
|
| 308 |
# Remove lastUpdated field - will only be set when an update is detected
|
| 309 |
}
|
| 310 |
+
|
| 311 |
+
# Add lastUpdated if it exists in the sheet
|
| 312 |
+
if last_updated and str(last_updated).strip():
|
| 313 |
+
processed_item['lastUpdated'] = str(last_updated).strip()
|
| 314 |
+
|
| 315 |
processed_data.append(processed_item)
|
| 316 |
return processed_data
|
| 317 |
|