Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/ingestors/indico_ingestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/files/ingestion/indico/event.ics
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/files/ingestion/indico/events.ics
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/unit/ingestors/indico_ingestor_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading