Skip to content

Commit a009441

Browse files
committed
fix(indico): zoom and Zoom in description allows online presence
1 parent c784f2f commit a009441

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

lib/ingestors/indico_ingestor.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,17 @@ def assign_location_info(event, calevent)
122122
location = calevent.location
123123
return if location.blank?
124124

125+
description = calevent.description.downcase
126+
online = description.include?('zoom')
127+
hybrid = description.include?('hybrid') && !description.include?('not hybrid') && !description.include?('not a hybrid')
128+
125129
event.venue = location.to_s
126-
event.online = calevent.description.include?('zoom')
127-
event.presence = calevent.description.include?('zoom') ? :hybrid : :onsite # can do best, but sufficient for now
130+
event.online = online || hybrid
131+
event.presence = if hybrid
132+
:hybrid
133+
else
134+
online ? :online : :onsite
135+
end
128136
end
129137

130138
# Extracts the timezone identifier (TZID) from an iCalendar event's dtstart field.

test/fixtures/files/ingestion/indico/event.ics

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DTEND:20260313T161500Z
88
DTSTAMP:20251204T105300Z
99
UID:indico-event-1617123@indico.cern.ch
1010
CONTACT:name.surname@test.com
11-
DESCRIPTION:speakers and zoom here
11+
DESCRIPTION:speakers and Zoom here, however it is not hybrid
1212
LOCATION:CERN
1313
URL:https://indico.cern.ch/event/1617123/
1414
CATEGORIES:TRAINING,EDUCATION

test/fixtures/files/ingestion/indico/events.ics

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DTEND:20260313T161500Z
88
DTSTAMP:20251203T150800Z
99
UID:indico-event-1617123@indico.cern.ch
1010
CONTACT:name.surname@test.com
11-
DESCRIPTION:speakers and zoom here
11+
DESCRIPTION:speakers and Zoom here, however it is not hybrid
1212
LOCATION:CERN
1313
URL:https://indico.cern.ch/event/1617123/
1414
END:VEVENT

test/unit/ingestors/indico_ingestor_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class IndicoIngestorTest < ActiveSupport::TestCase
2929

3030
assert_equal sample.url, 'https://indico.cern.ch/event/1617123/'
3131
assert_equal sample.title, '14th HEP C++ Course and Hands-on Training - The Essentials'
32-
assert_equal sample.description, 'speakers and zoom here'
32+
assert_equal sample.description, 'speakers and Zoom here, however it is not hybrid'
3333
assert_equal sample.keywords, %w[TRAINING EDUCATION]
3434
assert_equal sample.contact, 'name.surname@test.com'
3535
assert_equal sample.start, '2026-03-09 08:00:00 +0000'
3636
assert_equal sample.end, '2026-03-13 16:15:00 +0000'
3737
assert_equal sample.timezone, 'UTC'
3838
assert_equal sample.venue, 'CERN'
39-
assert_match sample.presence, 'hybrid'
39+
assert_match sample.presence, 'online'
4040
end
4141

4242
test 'should read indico link category' do

0 commit comments

Comments
 (0)