feat: Use meetecho-player.ietf.org for session recording (#7873)
This commit is contained in:
parent
c458c09375
commit
23e5307d2e
|
@ -1321,11 +1321,16 @@ class Session(models.Model):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def session_recording_url(self):
|
def session_recording_url(self):
|
||||||
url = getattr(settings, "MEETECHO_SESSION_RECORDING_URL", "")
|
url_formatter = getattr(settings, "MEETECHO_SESSION_RECORDING_URL", "")
|
||||||
if self.meeting.type.slug == "ietf" and self.has_onsite_tool and url:
|
url = None
|
||||||
self.group.acronym_upper = self.group.acronym.upper()
|
if url_formatter and self.video_stream_url:
|
||||||
return url.format(session=self)
|
if self.meeting.type.slug == "ietf" and self.has_onsite_tool:
|
||||||
return None
|
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):
|
class SchedulingEvent(models.Model):
|
||||||
|
|
|
@ -146,3 +146,47 @@ class SessionTests(TestCase):
|
||||||
self.assertEqual(session.chat_room_name(), 'plenary')
|
self.assertEqual(session.chat_room_name(), 'plenary')
|
||||||
session.chat_room = 'fnord'
|
session.chat_room = 'fnord'
|
||||||
self.assertEqual(session.chat_room_name(), '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"))
|
||||||
|
|
|
@ -1174,7 +1174,7 @@ CELERY_TASK_IGNORE_RESULT = True # ignore results unless specifically enabled f
|
||||||
MEETECHO_ONSITE_TOOL_URL = "https://meetings.conf.meetecho.com/onsite{session.meeting.number}/?session={session.pk}"
|
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_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_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
|
# 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.
|
# sensitive or site-specific changes. DO NOT commit settings_local.py to svn.
|
||||||
|
|
|
@ -146,17 +146,18 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endfor %}
|
{% 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"
|
<a class="btn btn-outline-primary"
|
||||||
href="{{ session.session_recording_url }}"
|
href="{{ session.session_recording_url }}"
|
||||||
aria-label="Meetecho session recording"
|
aria-label="Meetecho session recording"
|
||||||
title="Meetecho session recording">
|
title="Meetecho session recording">
|
||||||
<i class="bi bi-file-slides"></i>
|
<i class="bi bi-file-slides"></i>
|
||||||
</a>
|
</a>
|
||||||
{% elif show_empty %}
|
|
||||||
{# <i class="bi"></i> #}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
Loading…
Reference in a new issue