Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use meetecho-player.ietf.org for session recording #7873

Merged
merged 4 commits into from
Sep 3, 2024
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
15 changes: 10 additions & 5 deletions ietf/meeting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,11 +1321,16 @@ def onsite_tool_url(self):
return None

def session_recording_url(self):
url = getattr(settings, "MEETECHO_SESSION_RECORDING_URL", "")
if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url:
self.group.acronym_upper = self.group.acronym.upper()
return url.format(session=self)
return None
url_formatter = getattr(settings, "MEETECHO_SESSION_RECORDING_URL", "")
url = None
if url_formatter and self.video_stream_url:
if self.meeting.type.slug == "ietf" and self.has_onsite_tool:
session_label = f"IETF{self.meeting.number}-{self.group.acronym.upper()}-{self.official_timeslotassignment().timeslot.time.strftime('%Y%m%d-%H%M')}"
else:
session_label = f"IETF-{self.group.acronym.upper()}-{self.official_timeslotassignment().timeslot.time.strftime('%Y%m%d-%H%M')}"
url = url_formatter.format(session_label=session_label)

return url


class SchedulingEvent(models.Model):
Expand Down
44 changes: 44 additions & 0 deletions ietf/meeting/tests_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,47 @@ def test_chat_room_name(self):
self.assertEqual(session.chat_room_name(), 'plenary')
session.chat_room = 'fnord'
self.assertEqual(session.chat_room_name(), 'fnord')

def test_session_recording_url(self):
group_acronym = "foobar"
meeting_date = datetime.date.today()
meeting_number = 123

# IETF meeting
session = SessionFactory(
meeting__type_id='ietf',
meeting__date=meeting_date,
group__acronym=group_acronym,
meeting__number=meeting_number,
)
with override_settings():
if hasattr(settings, "MEETECHO_SESSION_RECORDING_URL"):
del settings.MEETECHO_SESSION_RECORDING_URL
self.assertIsNone(session.session_recording_url())

settings.MEETECHO_SESSION_RECORDING_URL = "http://player.example.com"
self.assertEqual(session.session_recording_url(), "http://player.example.com")

settings.MEETECHO_SESSION_RECORDING_URL = "http://player.example.com?{session_label}"
self.assertIn(f"IETF{meeting_number}-{group_acronym.upper()}", session.session_recording_url())
self.assertIn(f"{meeting_date.strftime('%Y%m%d')}", session.session_recording_url())
self.assertTrue(session.session_recording_url().startswith("http://player.example.com"))

# interim meeting
session = SessionFactory(
meeting__type_id='interim',
meeting__date=meeting_date,
group__acronym=group_acronym,
)
with override_settings():
if hasattr(settings, "MEETECHO_SESSION_RECORDING_URL"):
del settings.MEETECHO_SESSION_RECORDING_URL
self.assertIsNone(session.session_recording_url())

settings.MEETECHO_SESSION_RECORDING_URL = "http://player.example.com"
self.assertEqual(session.session_recording_url(), "http://player.example.com")

settings.MEETECHO_SESSION_RECORDING_URL = "http://player.example.com?{session_label}"
self.assertIn(f"IETF-{group_acronym.upper()}", session.session_recording_url())
self.assertIn(f"{meeting_date.strftime('%Y%m%d')}", session.session_recording_url())
self.assertTrue(session.session_recording_url().startswith("http://player.example.com"))
2 changes: 1 addition & 1 deletion ietf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ def skip_unreadable_post(record):
MEETECHO_ONSITE_TOOL_URL = "https://meetings.conf.meetecho.com/onsite{session.meeting.number}/?session={session.pk}"
MEETECHO_VIDEO_STREAM_URL = "https://meetings.conf.meetecho.com/ietf{session.meeting.number}/?session={session.pk}"
MEETECHO_AUDIO_STREAM_URL = "https://mp3.conf.meetecho.com/ietf{session.meeting.number}/{session.pk}.m3u"
MEETECHO_SESSION_RECORDING_URL = "https://www.meetecho.com/ietf{session.meeting.number}/recordings#{session.group.acronym_upper}"
MEETECHO_SESSION_RECORDING_URL = "https://meetecho-player.ietf.org/playout/?session={session_label}"

# Put the production SECRET_KEY in settings_local.py, and also any other
# sensitive or site-specific changes. DO NOT commit settings_local.py to svn.
Expand Down
9 changes: 5 additions & 4 deletions ietf/templates/meeting/interim_session_buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,18 @@
{% endif %}
{% endwith %}
{% endfor %}
{% elif session.video_stream_url %}
{% elif show_empty %}
{# <i class="bi"></i> #}
{% endif %}
{% if session.session_recording_url %}
<a class="btn btn-outline-primary"
href="{{ session.session_recording_url }}"
aria-label="Meetecho session recording"
title="Meetecho session recording">
<i class="bi bi-file-slides"></i>
</a>
{% elif show_empty %}
{# <i class="bi"></i> #}
{% endif %}
{% endwith %}
{% endif %}
</div>
{% endwith %}
{% endwith %}
Loading