Skip to content

Commit

Permalink
Merge branch 'main' into pod_V4
Browse files Browse the repository at this point in the history
# Conflicts:
#	.env.dev-exemple
#	dockerfile-dev-with-volumes/README.adoc
#	pod/main/test_settings.py
#	pod/video/models.py
#	pod/video/utils.py
#	requirements.txt
  • Loading branch information
Badatos committed Jan 24, 2025
2 parents e91fea4 + 57361bf commit 1b02e4f
Show file tree
Hide file tree
Showing 86 changed files with 1,050 additions and 596 deletions.
2 changes: 1 addition & 1 deletion .env.dev-exemple
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DJANGO_SUPERUSER_PASSWORD=<PWD>
DJANGO_SUPERUSER_EMAIL=<MAIL>
### You can use internal registry
ELASTICSEARCH_TAG=elasticsearch:8.16.1
NODE_TAG=node:19
NODE_TAG=node:23
PYTHON_TAG=python:3.9-bullseye
REDIS_TAG=redis:alpine3.16
### DOCKER_ENV: You can specify light or full.
Expand Down
13 changes: 13 additions & 0 deletions CONFIGURATION_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,16 @@ Mettre `USE_DRESSING` à True pour activer cette application.<br>
>> Activation des habillages.<br>
>> Permet aux utilisateurs de customiser une vidéo avec un filigrane et des crédits.<br>
### Configuration de l’application duplicate
Application Duplicate pour créer une copie du formulaire d’une vidéo existante<br>
Mettre `USE_DUPLICATE` à True pour activer cette application.<br>
* `USE_DUPLICATE`
> valeur par défaut : `False`
>> Activation de duplicate.<br>
>> Permet aux utilisateurs de dupliquer une vidéo<br>
### Configuration de l’application enrichment
Expand All @@ -1052,6 +1062,9 @@ Mettre `USE_SPEAKER` à True pour activer cette application.<br>
* `USE_SPEAKER`
> valeur par défaut : `False`
>> Activation de l’application Intervenant<br>
* `REQUIRED_SPEAKER_FIRSTNAME`
> valeur par défaut : `True`
>> Prénom obligatoire dans le formulaire d'ajout intervenant<br>
### Configuration de l’application d’import vidéo
Expand Down
4 changes: 2 additions & 2 deletions dockerfile-dev-with-volumes/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ v1.2, 2023-08-30
=== Conteneur ElasticSearch
http://elasticsearch.localhost:9200

==== elasticsearch:8.8.1
==== elasticsearch:8.16.1
===== OS/ARCH
----
OS/ARCH
Expand Down Expand Up @@ -51,7 +51,7 @@ DJANGO_SUPERUSER_USERNAME=
DJANGO_SUPERUSER_PASSWORD=
DJANGO_SUPERUSER_EMAIL=
ELASTICSEARCH_TAG=elasticsearch:8.16.1
NODE_TAG=node:19
NODE_TAG=node:23
PYTHON_TAG=python:3.9-bullseye
REDIS_TAG=redis:alpine3.16
DOCKER_ENV=light
Expand Down
7 changes: 2 additions & 5 deletions pod/ai_enhancement/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,8 @@ class Meta:
"aria-describedby": "id_titleHelp",
},
),
help_text=_(
"""
Please choose a title between 1 and 250 characters.
"""
),
help_text=_("Please choose a title between 1 and %(max)s characters.")
% {"max": 250},
)

description = forms.CharField(
Expand Down
69 changes: 36 additions & 33 deletions pod/completion/static/js/caption_maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ var captionBeingDisplayed = -1;

/**
* Display existing caption
* @param {[type]} seconds [description]
* @param {[type]} seconds - time in seconds
*/
function displayExistingCaption(seconds) {
var ci = findCaptionIndex(seconds);
Expand Down Expand Up @@ -360,7 +360,7 @@ function existingCaptionsEndTime() {

/**
* Update captions array.
* @param {[type]} vtt [description]
* @param {string} vtt - VTT string
*/
let updateCaptionsArray = (vtt) => {
let arr = vtt.split("\n\n");
Expand Down Expand Up @@ -665,8 +665,8 @@ let updateCaptionHtmlContent = () => {

/**
* Update caption.
* @param {[type]} ci caption index
* @param {[type]} captionText caption text
* @param {int} ci - caption index
* @param {string} captionText - caption text
*/
function updateCaption(ci, captionText) {
captionsArray[ci].caption = captionText;
Expand All @@ -677,8 +677,8 @@ let lastEditedBlock = null;

/**
* Create a caption block object.
* @param {Object} newCaption Simple object representing the caption block
* @param {Function} spawnFunction Function to call after block init
* @param {Object} newCaption - Simple object representing the caption block
* @param {Function} spawnFunction - Function to call after block init
*/
function createCaptionBlock(newCaption, spawnFunction) {
let captionText = newCaption.caption;
Expand Down Expand Up @@ -871,7 +871,7 @@ function createCaptionBlock(newCaption, spawnFunction) {

/**
* Spawn New Block
* @param {Event} e Triggered Event
* @param {Event} e - Triggered Event
*/
spawnNew: function (e) {
e.preventDefault();
Expand Down Expand Up @@ -900,7 +900,7 @@ function createCaptionBlock(newCaption, spawnFunction) {

/**
* Delete Block
* @param {Event} e Triggered Event
* @param {Event} e - Triggered Event
*/
delete: function (e) {
e.preventDefault();
Expand Down Expand Up @@ -961,11 +961,14 @@ function createCaptionBlock(newCaption, spawnFunction) {
this.div.append(this.numberCharactersDiv);
this.div.append(this.buttonsDiv);

const nbCharsMsg = gettext("%s/%s characters");
// Update numberCharactersDiv content
const updateCharacterCount = () => {
let nbCharacters = this.captionTextInput.value.length;
this.numberCharactersDiv.textContent =
nbCharacters + gettext("/80 characters");
this.numberCharactersDiv.textContent = interpolate(nbCharsMsg, [
nbCharacters,
80,
]);
if (nbCharacters > 80) {
this.numberCharactersDiv.append(this.numberCharactersAlert);
}
Expand Down Expand Up @@ -1140,8 +1143,8 @@ editorShortcuts.init();

/**
* Add caption list row
* @param {[type]} ci [description]
* @param {[type]} newCaption [description]
* @param {int} ci - Caption index
* @param {[type]} newCaption - Caption object
*/
function addCaptionListRow(ci, newCaption) {
let vtt = document.getElementById("caption-content");
Expand All @@ -1167,9 +1170,9 @@ function addCaptionListRow(ci, newCaption) {

/**
* Add caption
* @param {[type]} captionStart [description]
* @param {[type]} captionEnd [description]
* @param {[type]} captionText [description]
* @param {[type]} captionStart - Start time
* @param {[type]} captionEnd - End time
* @param {[type]} captionText - Caption content
*/
function addCaption(captionStart, captionEnd, captionText) {
const pod = document.getElementById("podvideoplayer");
Expand All @@ -1190,8 +1193,8 @@ function addCaption(captionStart, captionEnd, captionText) {

/**
* Convert HMS time format to seconds only
* @param {string} str hms
* @return {number} corresponding seconds
* @param {string} str - hms
* @return {number} - corresponding seconds
*/
function hmsToSecondsOnly(str) {
let p = str.split(":"),
Expand All @@ -1206,7 +1209,7 @@ function hmsToSecondsOnly(str) {

/**
* Parses webvtt time string format into floating point seconds
* @param {[type]} sTime [description]
* @param {[type]} sTime - Webvtt time string
*/
function parseTime(sTime) {
let seconds = hmsToSecondsOnly(sTime);
Expand All @@ -1228,7 +1231,7 @@ function parseTime(sTime) {

/**
* formats floating point seconds into the webvtt time string format
* @param {[type]} seconds [description]
* @param {[type]} seconds - floating point seconds
*/
function formatTime(seconds) {
var hh = Math.floor(seconds / (60 * 60));
Expand All @@ -1246,7 +1249,7 @@ function formatTime(seconds) {

/**
* Find caption index
* @param {[type]} seconds [description]
* @param {[type]} seconds - Time in seconds
*/
function findCaptionIndex(seconds) {
var below = -1;
Expand All @@ -1268,7 +1271,7 @@ function findCaptionIndex(seconds) {

/**
* Play selected caption
* @param {[type]} timeline [description]
* @param {string} timeline -
*/
function playSelectedCaption(timeline) {
if (timeline.includes("-->")) {
Expand All @@ -1288,7 +1291,7 @@ function playSelectedCaption(timeline) {

/**
* Escape Html entities
* @param {string} s String to be escaped
* @param {string} s - String to be escaped
*/
function XMLEncode(s) {
return s
Expand All @@ -1302,7 +1305,7 @@ function XMLEncode(s) {

/**
* Decode Html entities
* @param {String} s String to be decoded
* @param {String} s - String to be decoded
*/
function XMLDecode(s) {
return s
Expand All @@ -1315,7 +1318,7 @@ function XMLDecode(s) {

/**
* Load caption file
* @param {[type]} fileObject [description]
* @param {[type]} fileObject - File object to be loaded
*/
/*
function loadCaptionFile(fileObject) {
Expand Down Expand Up @@ -1344,7 +1347,7 @@ function loadCaptionFile(fileObject) {

/**
* Invoked by script insertion of proxyvtt.ashx
* @param {[type]} obj [description]
* @param {[type]} obj -
*/
function processProxyVttResponse(obj) {
obj = JSON.parse(obj);
Expand Down Expand Up @@ -1376,7 +1379,7 @@ function processProxyVttResponse(obj) {

/**
* Partial parser for WebVTT files based on the spec at http://dev.w3.org/html5/webvtt/
* @param {[type]} vtt [description]
* @param {[type]} vtt - VTT file content
*/
function parseAndLoadWebVTT(vtt) {
var vttLines = vtt.split(/\r\n|\r|\n/); // create an array of lines from our file
Expand Down Expand Up @@ -1460,8 +1463,8 @@ const registerPlugin = videojs.registerPlugin || videojs.plugin;

/**
* On player ready Event
* @param {[type]} player [description]
* @param {[type]} options [description]
* @param {[type]} player - Video player
* @param {[type]} options - Options (not used ?)
*/
const onPlayerReady = function (player, options) {
let startKeyframe;
Expand All @@ -1483,8 +1486,8 @@ const onPlayerReady = function (player, options) {

/**
* Highlight video region
* @param {[type]} startTime [description]
* @param {[type]} endTime [description]
* @param {[type]} startTime - Start time in seconds
* @param {[type]} endTime - End time in seconds
*/
highlightVideoRegion = function (startTime, endTime) {
clearVideoRegion();
Expand Down Expand Up @@ -1520,7 +1523,7 @@ const onPlayerReady = function (player, options) {

/**
* Seek video player to absolute `time`.
* @param {[type]} time [description]
* @param {[type]} time - absolute time target
*/
function seekVideoTo(time) {
player.userActive(true);
Expand All @@ -1529,7 +1532,7 @@ function seekVideoTo(time) {

/**
* Seek video player to relative `time`.
* @param {[type]} time [description]
* @param {[type]} time - relative time target
*/
function seekVideo(time) {
player.userActive(true);
Expand All @@ -1538,7 +1541,7 @@ function seekVideo(time) {

/**
* Timeline regions
* @param {[type]} options [description]
* @param {[type]} options - Video player options
*/
function timelineRegions(options) {
this.ready(function () {
Expand Down
10 changes: 5 additions & 5 deletions pod/completion/static/js/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ document.addEventListener("submit", (e) => {
/**
* Send and get form.
*
* @param elt {HTMLElement} HTML element.
* @param action {string} Action.
* @param name {string} Name.
* @param form {string} Form.
* @param list {string} List.
* @param {HTMLElement} elt - HTML element.
* @param {string} action - Action.
* @param {string} name - Name.
* @param {string} form - Form.
* @param {string} list - List.
*
* @return {Promise<void>} The form promise.
*/
Expand Down
Empty file added pod/duplicate/__init__.py
Empty file.
Empty file added pod/duplicate/admin.py
Empty file.
7 changes: 7 additions & 0 deletions pod/duplicate/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _


class DuplicateConfig(AppConfig):
name = "pod.duplicate"
verbose_name = _("Video duplicates")
12 changes: 12 additions & 0 deletions pod/duplicate/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Esup-Pod duplicate context processor."""

from django.conf import settings as django_settings

USE_DUPLICATE = getattr(django_settings, "USE_DUPLICATE", False)


def context_settings(request):
"""Return all context settings for duplicate app."""
new_settings = {}
new_settings["USE_DUPLICATE"] = USE_DUPLICATE
return new_settings
Empty file added pod/duplicate/models.py
Empty file.
Loading

0 comments on commit 1b02e4f

Please sign in to comment.