Skip to content

Commit

Permalink
Merge pull request numerique-gouv#118 from yaal-coop/issue-98-recordi…
Browse files Browse the repository at this point in the history
…ngs-data

Information de conservation des enregistrements
  • Loading branch information
klorydryk authored Mar 29, 2024
2 parents 04b6df4 + 8b79991 commit 66c9c30
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
10 changes: 7 additions & 3 deletions web/b3desk/models/bbb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions web/b3desk/settings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import json
from typing import Any
from typing import Dict
Expand Down Expand Up @@ -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."""

Expand Down
11 changes: 8 additions & 3 deletions web/b3desk/templates/meeting/recordings.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,26 @@ <h1 class="fr-h2">{% trans meeting_name=meeting.name %}Enregistrements de <em>{{
{% endif %}
<p>{% 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 %}</p>
<p>{% 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 %}</p>
<p>{% trans duration=config["RECORDING_DURATION"]|timedeltaformat %}Les enregistrements sont conservés pour une période de {{ duration }}.{% endtrans %}</p>
{% for recording in meeting.get_recordings() %}
{% set recording_name = recording.name or recording.start_date.strftime("%d/%m/%Y") %}
<h3>
<h3 class="fr-h3">
{{ recording_name }}
<button
class="fr-btn fr-btn--secondary js-modal fr-mr-2w fr-mt-1w"
title="Renommer l'enregistrement"
title="{% trans %}Renommer lenregistrement{% endtrans %}"
aria-label="Renommer l'enregistrement"
data-modal-content-id="rename-video-{{ recording.recordID }}"
data-modal-title="Renommer l'enregistrement"
data-modal-title="{% trans %}Renommer lenregistrement{% endtrans %}"
data-modal-close-text="x"
data-modal-close-title="Fermer la fenêtre modale">
<span class="fr-icon-edit-line"></span>
</button>
</h3>
{% 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 %}
<div class="fr-table fr-table--bordered fr-table--layout-fixed">
<table>
<thead>
Expand Down

0 comments on commit 66c9c30

Please sign in to comment.