|
35 | 35 | from services.storage_service import upload_image_from_url |
36 | 36 | from shared.constants.user_agents import USER_AGENTS |
37 | 37 | from utils.embedding_utils import find_similar_events |
38 | | -from utils.events_utils import clean_datetime |
| 38 | +from utils.events_utils import clean_datetime, clean_duration |
39 | 39 |
|
40 | 40 | MAX_POSTS = int(os.getenv("MAX_POSTS", "100")) |
41 | 41 | MAX_CONSEC_OLD_POSTS = 10 |
@@ -127,7 +127,7 @@ def append_event_to_csv( |
127 | 127 | dtend = dtend.replace(tzinfo=pytimezone.utc) if dtend else None |
128 | 128 | dtstart_utc = clean_datetime(event_data.get("dtstart_utc")) |
129 | 129 | dtend_utc = clean_datetime(event_data.get("dtend_utc")) |
130 | | - duration = event_data.get("duration") |
| 130 | + duration = clean_duration(event_data.get("duration")) |
131 | 131 | all_day = event_data.get("all_day") |
132 | 132 | location = event_data.get("location", "") |
133 | 133 | food = event_data.get("food", "") |
@@ -215,7 +215,7 @@ def insert_event_to_db(event_data, ig_handle, source_url): |
215 | 215 | dtend = dtend.replace(tzinfo=pytimezone.utc) if dtend else None |
216 | 216 | dtstart_utc = clean_datetime(event_data.get("dtstart_utc")) |
217 | 217 | dtend_utc = clean_datetime(event_data.get("dtend_utc")) |
218 | | - duration = event_data.get("duration") |
| 218 | + duration = clean_duration(event_data.get("duration")) |
219 | 219 | all_day = event_data.get("all_day") |
220 | 220 | source_image_url = event_data.get("source_image_url") or "" |
221 | 221 | description = event_data.get("description", "") or "" |
|
0 commit comments