From 24466aa89d79ae6e23a3e20a646b22bb599bd704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 27 Mar 2024 12:04:50 +0100 Subject: [PATCH] feat: display additional recordings information --- web/b3desk/models/bbb.py | 10 +++++++--- web/b3desk/settings.py | 7 +++++++ web/b3desk/templates/meeting/recordings.html | 11 ++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/web/b3desk/models/bbb.py b/web/b3desk/models/bbb.py index ab468dd7..eaba718a 100644 --- a/web/b3desk/models/bbb.py +++ b/web/b3desk/models/bbb.py @@ -230,6 +230,13 @@ def get_recordings(self): name = recording.find("metadata").find("name") data["name"] = name.text if name is not None else None data["participants"] = int(recording.find("participants").text) + data["start_date"] = datetime.fromtimestamp( + int(recording.find("startTime").text) / 1000.0, tz=timezone.utc + ).replace(microsecond=0) + data["end_date"] = datetime.fromtimestamp( + int(recording.find("endTime").text) / 1000.0, tz=timezone.utc + ).replace(microsecond=0) + data["playbacks"] = {} playback = recording.find("playback") if not playback: @@ -251,9 +258,6 @@ def get_recordings(self): "url": format.find("url").text, "images": images, } - data["start_date"] = datetime.fromtimestamp( - int(recording.find("startTime").text) / 1000.0, tz=timezone.utc - ).replace(microsecond=0) result.append(data) except Exception as exception: current_app.logger.error(exception) diff --git a/web/b3desk/settings.py b/web/b3desk/settings.py index 9f72cdde..df22b93d 100644 --- a/web/b3desk/settings.py +++ b/web/b3desk/settings.py @@ -1,3 +1,4 @@ +import datetime import json from typing import Any from typing import Dict @@ -914,6 +915,12 @@ def get_moderator_welcome_message( RECORDING: bool = False """Active la fonctionnalité d’enregistrement des réunions.""" + RECORDING_DURATION: Optional[datetime.timedelta] = datetime.timedelta(days=365) + """Durée par défaut de conservation des enregistrements. + + Utilisé à des fins d’affichage seulement. + """ + BETA: bool = False """Active l’encart « Bêta » dans l’entête du service B3Desk.""" diff --git a/web/b3desk/templates/meeting/recordings.html b/web/b3desk/templates/meeting/recordings.html index 48e99a73..839cc066 100644 --- a/web/b3desk/templates/meeting/recordings.html +++ b/web/b3desk/templates/meeting/recordings.html @@ -17,21 +17,26 @@

{% trans meeting_name=meeting.name %}Enregistrements de {{ {% endif %}

{% trans %}Après la fin d'{{ a_meeting }}, l'encodage de l'enregistrement peut prendre autant de temps que la durée {{ of_the_meeting }}.{% endtrans %}

{% trans %}Si aucun modérateur ne met fin {{ of_the_meeting }}, un délai supplémentaire de plusieurs minutes s'ajoute après que tous les utilisateurs l'aient quitté.{% endtrans %}

+

{% trans duration=config["RECORDING_DURATION"]|timedeltaformat %}Les enregistrements sont conservés pour une période de {{ duration }}.{% endtrans %}

{% for recording in meeting.get_recordings() %} {% set recording_name = recording.name or recording.start_date.strftime("%d/%m/%Y") %} -

+

{{ recording_name }}

+ {% trans start_date=recording.start_date|dateformat, expiration_date=(recording.end_date+config["RECORDING_DURATION"])|dateformat %} + Enregistré le {{ start_date }} - + Expire le {{ expiration_date }} + {% endtrans %}