diff --git a/lib/ingestors/indico_ingestor.rb b/lib/ingestors/indico_ingestor.rb index 475eb595a..4b8f0f5d4 100644 --- a/lib/ingestors/indico_ingestor.rb +++ b/lib/ingestors/indico_ingestor.rb @@ -122,9 +122,17 @@ def assign_location_info(event, calevent) location = calevent.location return if location.blank? + description = calevent.description.downcase + online = description.include?('zoom') + hybrid = description.include?('hybrid') && !description.include?('not hybrid') && !description.include?('not a hybrid') + event.venue = location.to_s - event.online = calevent.description.include?('zoom') - event.presence = calevent.description.include?('zoom') ? :hybrid : :onsite # can do best, but sufficient for now + event.online = online || hybrid + event.presence = if hybrid + :hybrid + else + online ? :online : :onsite + end end # Extracts the timezone identifier (TZID) from an iCalendar event's dtstart field. diff --git a/test/fixtures/files/ingestion/indico/event.ics b/test/fixtures/files/ingestion/indico/event.ics index 58728eadf..61c007b8b 100644 --- a/test/fixtures/files/ingestion/indico/event.ics +++ b/test/fixtures/files/ingestion/indico/event.ics @@ -8,7 +8,7 @@ DTEND:20260313T161500Z DTSTAMP:20251204T105300Z UID:indico-event-1617123@indico.cern.ch CONTACT:name.surname@test.com -DESCRIPTION:speakers and zoom here +DESCRIPTION:speakers and Zoom here, however it is not hybrid LOCATION:CERN URL:https://indico.cern.ch/event/1617123/ CATEGORIES:TRAINING,EDUCATION diff --git a/test/fixtures/files/ingestion/indico/events.ics b/test/fixtures/files/ingestion/indico/events.ics index 7f3bbfd22..08fa71614 100644 --- a/test/fixtures/files/ingestion/indico/events.ics +++ b/test/fixtures/files/ingestion/indico/events.ics @@ -8,7 +8,7 @@ DTEND:20260313T161500Z DTSTAMP:20251203T150800Z UID:indico-event-1617123@indico.cern.ch CONTACT:name.surname@test.com -DESCRIPTION:speakers and zoom here +DESCRIPTION:speakers and Zoom here, however it is not hybrid LOCATION:CERN URL:https://indico.cern.ch/event/1617123/ END:VEVENT diff --git a/test/unit/ingestors/indico_ingestor_test.rb b/test/unit/ingestors/indico_ingestor_test.rb index 7d9183df7..4d152ca03 100644 --- a/test/unit/ingestors/indico_ingestor_test.rb +++ b/test/unit/ingestors/indico_ingestor_test.rb @@ -29,14 +29,14 @@ class IndicoIngestorTest < ActiveSupport::TestCase assert_equal sample.url, 'https://indico.cern.ch/event/1617123/' assert_equal sample.title, '14th HEP C++ Course and Hands-on Training - The Essentials' - assert_equal sample.description, 'speakers and zoom here' + assert_equal sample.description, 'speakers and Zoom here, however it is not hybrid' assert_equal sample.keywords, %w[TRAINING EDUCATION] assert_equal sample.contact, 'name.surname@test.com' assert_equal sample.start, '2026-03-09 08:00:00 +0000' assert_equal sample.end, '2026-03-13 16:15:00 +0000' assert_equal sample.timezone, 'UTC' assert_equal sample.venue, 'CERN' - assert_match sample.presence, 'hybrid' + assert_match sample.presence, 'online' end test 'should read indico link category' do