Skip to content

Commit

Permalink
Merge pull request #196 from EsupPortail/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ptitloup authored Dec 9, 2019
2 parents 3e3e2c2 + e2b32b7 commit 177befd
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 299 deletions.
Binary file modified pod/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
554 changes: 278 additions & 276 deletions pod/locale/fr/LC_MESSAGES/django.po

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions pod/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ class ContactUsForm(forms.Form):
required=True)

captcha = CaptchaField(
label=_('Please indicate the result of'
' the following operation hereunder'))
label=_('Please indicate the result of the following operation'))

url_referrer = forms.URLField(required=False, widget=forms.HiddenInput())

Expand Down
7 changes: 5 additions & 2 deletions pod/main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@
#
CAPTCHA_CHALLENGE_FUNCT = 'captcha.helpers.math_challenge'
# ('captcha.helpers.noise_arcs','captcha.helpers.noise_dots',)
CAPTCHA_NOISE_FUNCTIONS = ('captcha.helpers.noise_null',)

CAPTCHA_NOISE_FUNCTIONS = (
'captcha.helpers.noise_arcs', 'captcha.helpers.noise_dots',)
# ('captcha.helpers.noise_null',)
CAPTCHA_FONT_SIZE = 32
CAPTCHA_MATH_CHALLENGE_OPERATOR = 'x'
##
# THIRD PARTY APPS OPTIONNAL
#
Expand Down
2 changes: 1 addition & 1 deletion pod/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
##
# Version of the project
#
VERSION = '2.4'
VERSION = '2.4.1'

##
# Installed applications list
Expand Down
36 changes: 19 additions & 17 deletions pod/video/transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,27 @@ def main_transcript(video_to_encode):

sentences = get_sentences(metadata, refItem, index)

last_item = (sentences[-1][-1].character, sentences[-1][-1].start_time)
last_item = (
sentences[-1][-1].character, sentences[-1][-1].start_time
) if len(sentences) > 0 else ()

for sent in sentences:

start_time = sent[0].start_time + start_trim
end_time = sent[-1].start_time + start_trim
str_sentence = ''.join(item.character for item in sent)
# print(start_time, end_time, str_sentence)
caption = Caption(
'%s.%s' % (timedelta(
seconds=int(str(start_time).split('.')[0])),
str('%.3f' % start_time).split('.')[1]),
'%s.%s' % (timedelta(
seconds=int(str(end_time).split('.')[0])),
str('%.3f' % end_time).split('.')[1]),
['%s' % str_sentence]
)

webvtt.captions.append(caption)
if len(sent) > 0:
start_time = sent[0].start_time + start_trim
end_time = sent[-1].start_time + start_trim
str_sentence = ''.join(item.character for item in sent)
# print(start_time, end_time, str_sentence)
caption = Caption(
'%s.%s' % (timedelta(
seconds=int(str(start_time).split('.')[0])),
str('%.3f' % start_time).split('.')[1]),
'%s.%s' % (timedelta(
seconds=int(str(end_time).split('.')[0])),
str('%.3f' % end_time).split('.')[1]),
['%s' % str_sentence]
)

webvtt.captions.append(caption)
# print(webvtt)
msg += saveVTT(video_to_encode, webvtt)
inference_end = timer() - inference_start
Expand Down
2 changes: 2 additions & 0 deletions pod_nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ server {

# max upload size
client_max_body_size 4G; # adjust to taste
# Allow to download large files
uwsgi_max_temp_file_size 0;

#location ^~ /video_edit {
# track_uploads uploadp 30s
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ webvtt-py==0.4.2
django-cas-client==1.5.2
ldap3==2.5
django-progressbarupload==0.1.7
django-simple-captcha==0.5.7
django-simple-captcha==0.5.12
urllib3==1.24.2
elasticsearch==6.3.1
djangorestframework==3.9.1
Expand Down

0 comments on commit 177befd

Please sign in to comment.