diff --git a/src/agenda_culturel/import_tasks/custom_extractors/acolab.py b/src/agenda_culturel/import_tasks/custom_extractors/acolab.py index f132cdc..5466b38 100644 --- a/src/agenda_culturel/import_tasks/custom_extractors/acolab.py +++ b/src/agenda_culturel/import_tasks/custom_extractors/acolab.py @@ -63,9 +63,14 @@ class CExtractor(Extractor): if not date is None and is_open: # we reach a new day result.append((date, tstart, tend)) - date = day - tstart = None - tend = None + if isinstance(day, tuple): + date = day[0] + tstart = day[1] + tend = day[2] + else: + date = day + tstart = None + tend = None is_open = False continue elif not is_open: @@ -79,8 +84,14 @@ class CExtractor(Extractor): hours = CExtractor.find_hours(e) if not hours is None: # we found hours - tstart = hours[0] - tend = hours[1] + if tstart is None: + tstart = hours[0] + else: + tstart = min(tstart, hours[0]) + if tend is None: + tend = hours[1] + else: + tend = max(tend, hours[1]) continue if CExtractor.is_canceled(e):