diff --git a/.gitguardian.yml b/.gitguardian.yml index 663b27ba00..78ab32525d 100644 --- a/.gitguardian.yml +++ b/.gitguardian.yml @@ -1,2 +1,4 @@ -exclude_paths: +version: 2 +secret: + ignored_paths: - pod/enrichment/tests/test_views.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 68b5d5639c..2cef09ccc7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/gitguardian/ggshield - rev: v1.27.0 + rev: v1.32.0 hooks: - id: ggshield language_version: python3 - stages: [commit] + stages: [pre-commit] diff --git a/CONFIGURATION_EN.md b/CONFIGURATION_EN.md index d35e4650b3..9df96d69ab 100644 --- a/CONFIGURATION_EN.md +++ b/CONFIGURATION_EN.md @@ -1,6 +1,6 @@ -# +# -## +## * `CAS` > default value: `1.5.2` @@ -29,7 +29,7 @@ * `tagging` > default value: `0.5.0` -## +## ### Database @@ -381,7 +381,7 @@ > default value: `False` >> -## +## ### AI Enhancement application configuration @@ -415,7 +415,7 @@ Set `USE_AI_ENHANCEMENT` to True to activate this application.
> default value: `False` >> Activation of artificial intelligence enhancements. Allows users to use it.
-### +### * `AFFILIATION` > default value: `` @@ -559,10 +559,10 @@ Set `USE_AI_ENHANCEMENT` to True to activate this application.
> default value: `False` >> -### +### -### +### * `ACTIVE_MODEL_ENRICH` > default value: `False` @@ -619,7 +619,7 @@ Set `USE_DRESSING` to True to activate this application.
> default value: `True` >> Activation of dressings. Allows users to customize a video with watermark & credits.
-### +### ### Seaker application configuration @@ -659,7 +659,7 @@ Set `USE_IMPORT_VIDEO` to True to activate this application.
> default value: `True` >> Directory that will contain the video files generated by bbb-recorder.
-### +### * `AFFILIATION_EVENT` > default value: `['faculty', 'employee', 'staff']` @@ -717,7 +717,7 @@ Set `USE_IMPORT_VIDEO` to True to activate this application.
> default value: `60` >> -### +### * `LTI_ENABLED` > default value: `False` @@ -737,7 +737,7 @@ Set `USE_IMPORT_VIDEO` to True to activate this application.
>> ``` >> -### +### * `HOMEPAGE_VIEW_VIDEOS_FROM_NON_VISIBLE_CHANNELS` > default value: `False` @@ -764,7 +764,7 @@ Set `USE_IMPORT_VIDEO` to True to activate this application.
> default value: `False` >> Webtv mode allows you to switch POD into a webtv application removing the connection buttons for example
-### +### @@ -864,7 +864,7 @@ Set `USE_PLAYLIST` to True to activate this application.
> default value: `True` >> Activation of promoted playlists. Allows users to use the promoted playlists.
-### +### * `FILES_DIR` > default value: `files` @@ -879,7 +879,7 @@ Set `USE_PLAYLIST` to True to activate this application.
> default value: `('jpg', 'jpeg', 'bmp', 'png', 'gif', 'tiff', 'webp')` >> Allowed extensions for images uploaded in the file manager (must be lowercase).
-### +### * `USE_NOTIFICATIONS` > default value: `True` @@ -906,7 +906,7 @@ Set `USE_QUIZ` to True to activate this application.
> default value: `True` >> Activation of quizzes. Allows users to create, respond and use quizzes in videos.
-### +### * `ALLOW_MANUAL_RECORDING_CLAIMING` > default value: `False` @@ -968,7 +968,7 @@ Set `USE_QUIZ` to True to activate this application.
> default value: `False` >> If True, displays the video preview icon in the "Claim a recording" page.
-### +### * `ACTIVE_VIDEO_COMMENT` > default value: `False` @@ -1076,7 +1076,7 @@ Set `USE_QUIZ` to True to activate this application.
> default value: `False` >> -### +### @@ -1125,7 +1125,7 @@ Set `USE_QUIZ` to True to activate this application.
> default value: `[]` >> -### +### * `ES_INDEX` > default value: `pod` @@ -1146,7 +1146,7 @@ Set `USE_QUIZ` to True to activate this application.
> default value: `{}` >> -### +### Application for sending xAPI statements to an LRS.
No statements persist in Pod, they are all sent to the configured LRS.
diff --git a/CONFIGURATION_FR.md b/CONFIGURATION_FR.md index 5a55921fbe..e1ea0c19c1 100644 --- a/CONFIGURATION_FR.md +++ b/CONFIGURATION_FR.md @@ -748,6 +748,10 @@ Mettre `USE_AI_ENHANCEMENT` à True pour activer cette application.
* `USE_AI_ENHANCEMENT` > valeur par défaut : `False` >> Activation des améliorations de l'intelligence artificielle. Permet aux utilisateurs de l'utiliser.
+* `AI_ENHANCEMENT_PROXY_URL` + > valeur par défaut : `` + >> L’URL du serveur proxy pour les requêtes venant d'Aristote.
+ >> Exemple : ''
### Configuration de l’application authentification diff --git a/Makefile b/Makefile index f5eaae6da9..e29ae0170c 100755 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ # Affiche la liste des commandes disponibles help: - echo "Syntax: [make target] where target is in this list:" + @echo "Syntax: [make target] where target is in this list:" @awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t # Démarre le serveur de test diff --git a/pod/ai_enhancement/views.py b/pod/ai_enhancement/views.py index f2903303b0..0db42c7e07 100644 --- a/pod/ai_enhancement/views.py +++ b/pod/ai_enhancement/views.py @@ -34,6 +34,7 @@ settings, "AI_ENHANCEMENT_CLIENT_SECRET", "mocked_secret" ) AI_ENHANCEMENT_TO_STAFF_ONLY = getattr(settings, "AI_ENHANCEMENT_TO_STAFF_ONLY", True) +AI_ENHANCEMENT_PROXY_URL = getattr(settings, "AI_ENHANCEMENT_PROXY_URL", "") LANG_CHOICES = getattr( settings, "LANG_CHOICES", @@ -95,14 +96,16 @@ def send_enhancement_creation_request( + request.user.username ).encode("utf-8") ).hexdigest() + if AI_ENHANCEMENT_PROXY_URL: + base_url = AI_ENHANCEMENT_PROXY_URL + else: + base_url = url_scheme + "://" + get_current_site(request).domain + creation_response = aristote.create_enhancement_from_url( - url_scheme + "://" + get_current_site(request).domain + mp3_url, + base_url + mp3_url, ["video/mp3"], end_user_identifier + "@%s" % get_current_site(request).domain, - url_scheme - + "://" - + get_current_site(request).domain - + reverse("ai_enhancement:webhook"), + base_url + reverse("ai_enhancement:webhook"), ) if creation_response: if creation_response["status"] == "OK": diff --git a/pod/completion/admin.py b/pod/completion/admin.py index 12de1b4dbf..4c404f292d 100644 --- a/pod/completion/admin.py +++ b/pod/completion/admin.py @@ -241,6 +241,7 @@ def enrich_kaldi_model_launch() -> None: @admin.action(description=_("Enrich with selected subtitles")) def enrich_model(modeladmin, request, queryset) -> None: + """Enrich with selected subtitles.""" text = "" title = "" for query in list(queryset.all()): @@ -249,7 +250,7 @@ def enrich_model(modeladmin, request, queryset) -> None: title += query.video.title file = query.src.file for caption in webvtt.read(file.path): - text += caption.text + " \n" + text += caption.text + "\n" query.enrich_ready = False query.save() diff --git a/pod/dressing/templates/my_dressings.html b/pod/dressing/templates/my_dressings.html index 14711c212f..75ae58e380 100644 --- a/pod/dressing/templates/my_dressings.html +++ b/pod/dressing/templates/my_dressings.html @@ -91,10 +91,15 @@ {% endif %}
- + - +
diff --git a/pod/import_video/forms.py b/pod/import_video/forms.py index 1a858eb0d9..7ea44d8e17 100644 --- a/pod/import_video/forms.py +++ b/pod/import_video/forms.py @@ -42,13 +42,13 @@ class ExternalRecordingForm(forms.ModelForm): ), ) - def filter_fields_admin(form): + def filter_fields_admin(form) -> None: """List fields, depends on user right.""" if not form.is_superuser and not form.is_admin: form.remove_field("owner") form.remove_field("site") - def clean(self): + def clean(self) -> None: """Clean method.""" cleaned_data = super(ExternalRecordingForm, self).clean() try: diff --git a/pod/import_video/templates/import_video/add_or_edit.html b/pod/import_video/templates/import_video/add_or_edit.html index 65ccef3744..913006baa0 100644 --- a/pod/import_video/templates/import_video/add_or_edit.html +++ b/pod/import_video/templates/import_video/add_or_edit.html @@ -33,7 +33,7 @@ {% if form.errors %}

{% trans "One or more errors have been found in the form." %}
{% for error in form.non_field_errors %} - - {{ error }}
+ - {{ error }}
{% endfor %}

{% endif %} diff --git a/pod/import_video/utils.py b/pod/import_video/utils.py index efd895a7c2..fd1394cb0f 100644 --- a/pod/import_video/utils.py +++ b/pod/import_video/utils.py @@ -457,9 +457,7 @@ def check_source_url(source_url: str): # noqa: C901 # https://xxx/playback/presentation/2.0/playback.html?meetingId=ID # to https://xxx/playback/presentation/2.3/ID?meetingId=ID media_id = array_url[-1] - source_video_url = source_url.replace( - "/2.0/playback.html", "/2.3/" + media_id - ).replace("playback.html?meetingId=", "") + source_video_url = source_url format = "webm" platform = "BBB_Presentation" elif source_url.find("/playback/presentation/2.3/") != -1: diff --git a/pod/live/templates/live/event-info.html b/pod/live/templates/live/event-info.html index 9d4f44fdbb..aec2f1b631 100644 --- a/pod/live/templates/live/event-info.html +++ b/pod/live/templates/live/event-info.html @@ -118,11 +118,13 @@