Skip to content

Commit

Permalink
Merge pull request #406 from EsupPortail/dev
Browse files Browse the repository at this point in the history
Dev V2.7.3
Add remote transcoding
Bump version for dependencies 
Improve rest API (status, video data, etc.)
Update video player (new version, add jump to 10sec )
Fix bug with language/podfile/caption
Add compatibility with Elasticsearch 7
Support Cookie SameSite
Improve Comment
Add posibility to add more video required fields
Active chapters on enriched video version
Fix check_obsolete_videos user notification 
Add FFMPEG_SCALE paramater
  • Loading branch information
ptitloup authored Feb 11, 2021
2 parents 01af142 + e19fc22 commit 4b54b03
Show file tree
Hide file tree
Showing 144 changed files with 7,107 additions and 134,795 deletions.
2 changes: 1 addition & 1 deletion pod/authentication/rest_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):

class Meta:
model = User
fields = ('id', 'url', 'username', 'first_name',
fields = ('id', 'url', 'username', 'first_name', 'is_staff',
'last_name', 'email', 'groups')


Expand Down
3 changes: 1 addition & 2 deletions pod/authentication/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2>{% trans 'Log in' %}</h2>
{% if user.is_authenticated %}
<p class="errornote">
{% blocktrans trimmed %}
You are authenticated as {{ username }}, but are not authorized to
You are authenticated as {{ user }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblocktrans %}
</p>
Expand All @@ -52,7 +52,6 @@ <h2>{% trans 'Log in' %}</h2>
<input type="hidden" name="next" value="{{ next }}">
</div>



{% url 'admin_password_reset' as password_reset_url %}
{% if password_reset_url %}
Expand Down
22 changes: 11 additions & 11 deletions pod/completion/static/js/caption_maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ const caption_memories = {
const file_prefix = window.location.pathname.match(/[\d\w\-]+\/$/)[0].replace("/", "");

$(document).on('click', 'a.file-name, a.file-image', function() {
let url = '/podfile/get_file/file/';
let url = '/podfile/get_file/file/';
let data_form = $("#captionmaker_form" ).serializeArray();
send_form_data(url, data_form, "ProcessProxyVttResponse");
})

// Charge caption/subtitle file if exists
$(document).ready(function(){

let url_search = new URLSearchParams(window.location.search);
if(url_search.has('src') && !isNaN(url_search.get('src')))
{
Expand Down Expand Up @@ -64,17 +64,17 @@ var send_form_save_captions = function(name) {
alert("Not a valid time track file.");
return;
}
let n = name
let n = name
let f = new File([vttContent], n + '.vtt', {type: 'text/vtt'});
let data_form = new FormData($('#form_save_captions')[0]);
data_form.append('folder', current_folder);
data_form.append('file', f);
$.ajax({
url: $("#form_save_captions").attr("action"),
url: $("#form_save_captions").attr("action"),
type: 'POST',
data: data_form,
processData: false,
contentType: false
contentType: false
}).done(function(data){
$(data).find('#base-message-alert').appendTo(document.body);
}).fail(function($xhr){
Expand Down Expand Up @@ -110,7 +110,7 @@ $('#podvideoplayer').on('error', function(event) {

$('#clearAllCaptions').on('click', function (e) {
e.preventDefault();
var deleteConfirm = confirm(gettext("Are you sure you want to delete all caption ?"));
var deleteConfirm = confirm(gettext("Are you sure you want to delete all caption?"));
if (deleteConfirm){
captionsArray.length = 0;
autoPauseAtTime = -1;
Expand Down Expand Up @@ -252,7 +252,7 @@ function SaveCurrentCaption() {
var ci = FindCaptionIndex(playTime - 1);
if (ci != -1) {
UpdateCaption(ci, new_entry);
}
}
} else {
AddCaption(captionsEndTime, playTime, new_entry);
}
Expand Down Expand Up @@ -318,7 +318,7 @@ function hmsToSecondsOnly(str){
m *= 60;
}
return s;
}
}

// parses webvtt time string format into floating point seconds
function ParseTime(sTime) {
Expand Down Expand Up @@ -354,7 +354,7 @@ function FindCaptionIndex(seconds) {
while (below < i && i < above) {
if (captionsArray[i].start <= seconds && seconds < captionsArray[i].end)
return i;

if (seconds < captionsArray[i].start) {
above = i;
} else {
Expand Down Expand Up @@ -383,8 +383,8 @@ function playSelectedCaption(timeline) {
/**
* Escape Html entities
*/
function XMLEncode(s) {
return s.replace(/\&/g, '&amp;').replace(//g, '&quot;').replace(//g,'&quot;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
function XMLEncode(s) {
return s.replace(/\&/g, '&amp;').replace(//g, '&quot;').replace(//g,'&quot;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}

function XMLDecode(s) {
Expand Down
8 changes: 4 additions & 4 deletions pod/completion/static/js/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ var sendandgetform = function(elt, action, name, form, list) {
if (action == 'delete') {
var deleteConfirm = '';
if (name == 'track') {
deleteConfirm = confirm(gettext('Are you sure you want to delete this file ?'));
deleteConfirm = confirm(gettext('Are you sure you want to delete this file?'));
} else if (name == 'contributor') {
deleteConfirm = confirm(gettext('Are you sure you want to delete this contributor ?'));
deleteConfirm = confirm(gettext('Are you sure you want to delete this contributor?'));
} else if (name == 'document') {
deleteConfirm = confirm(gettext('Are you sure you want to delete this document ?'));
deleteConfirm = confirm(gettext('Are you sure you want to delete this document?'));
} else if (name == 'overlay') {
deleteConfirm = confirm(gettext('Are you sure you want to delete this overlay ?'));
deleteConfirm = confirm(gettext('Are you sure you want to delete this overlay?'));
}
if (deleteConfirm) {
var id = $(elt).find('input[name=id]').val();
Expand Down
2 changes: 1 addition & 1 deletion pod/completion/templates/video_caption_maker.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ <h2 class="modal-title">{% trans "Save captions file."%}</h2>

{% block more_script %}
<script>
var current_folder = {{ home_folder.id }};
var current_folder = {{ current_folder.id }};
var captionFileSourceUpdateTimer = null;
var file_loaded = false;
var file_loaded_id = undefined;
Expand Down
14 changes: 8 additions & 6 deletions pod/completion/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
def video_caption_maker(request, slug):
video = get_object_or_404(Video, slug=slug,
sites=get_current_site(request))
user_home_folder = get_object_or_404(
UserFolder, name="home", owner=request.user)

video_folder, created = UserFolder.objects.get_or_create(
name=video.slug, owner=request.user)
request.session['current_session_folder'] = video.slug
action = None
if request.user != video.owner and not (
request.user.is_superuser or request.user.has_perm(
Expand All @@ -54,16 +56,16 @@ def video_caption_maker(request, slug):
return render(
request,
'video_caption_maker.html',
{'home_folder': user_home_folder,
{'current_folder': video_folder,
'form_make_caption': form_caption,
'video': video})


@csrf_protect
@staff_member_required(redirect_field_name='referrer')
def video_caption_maker_save(request, video):
user_home_folder = get_object_or_404(
UserFolder, name="home", owner=request.user)
video_folder, created = UserFolder.objects.get_or_create(
name=video.slug, owner=request.user)
if (request.method == "POST"):
cur_folder = get_current_session_folder(request)
response = file_edit_save(request, cur_folder)
Expand All @@ -79,7 +81,7 @@ def video_caption_maker_save(request, video):
return render(
request,
'video_caption_maker.html',
{'home_folder': user_home_folder,
{'current_folder': video_folder,
'form_make_caption': form_caption,
'video': video})

Expand Down
6 changes: 3 additions & 3 deletions pod/custom/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# from django.contrib import admin

# Register your models here.
# from django.contrib import admin

# Register your models here.
10 changes: 5 additions & 5 deletions pod/custom/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.apps import AppConfig


class CustomConfig(AppConfig):
name = 'custom'
from django.apps import AppConfig


class CustomConfig(AppConfig):
name = 'custom'
6 changes: 3 additions & 3 deletions pod/custom/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# from django.db import models

# Create your models here.
# from django.db import models

# Create your models here.
Loading

0 comments on commit 4b54b03

Please sign in to comment.