• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

EsupPortail / Esup-Pod / 7975424731

20 Feb 2024 02:54PM UTC coverage: 70.49% (+0.3%) from 70.212%
7975424731

Pull #1054

github

web-flow
[DONE] Pampletousse/fix captcha lib version (#1060)

* Change default sort dashboard videos title into date_added

* Change django-simple-captcha to fix error 500

---------

Co-authored-by: pampletousse <sylvain.loppin@grenet.fr>
Pull Request #1054: [WIP] Develop #3.5.1

197 of 283 new or added lines in 14 files covered. (69.61%)

6 existing lines in 6 files now uncovered.

9870 of 14002 relevant lines covered (70.49%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pod/video_encode_transcript/importing_transcript_tasks.py
1
"""Esup-Pod import transcription tasks."""
2

UNCOV
3
from celery import Celery
×
4

5
try:
×
6
    from ..custom import settings_local
×
7
except ImportError:
×
8
    from .. import settings as settings_local
×
9
import logging
×
10
import os
×
11
import webvtt
×
12

13
logger = logging.getLogger(__name__)
×
14

15
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pod.settings")
×
16

17
ENCODING_TRANSCODING_CELERY_BROKER_URL = getattr(
×
18
    settings_local, "ENCODING_TRANSCODING_CELERY_BROKER_URL", ""
19
)
20

21
importing_transcript_app = Celery(
×
22
    "importing_transcript_tasks", broker=ENCODING_TRANSCODING_CELERY_BROKER_URL
23
)
24
importing_transcript_app.conf.task_routes = {
×
25
    "pod.video_encode_transcript.importing_transcript_tasks.*": {
26
        "queue": "importing_transcript"
27
    }
28
}
29

30

31
# celery \
32
# -A pod.video_encode_transcript.importing_transcript_tasks worker \
33
# -l INFO -Q importing_transcript
34
@importing_transcript_app.task
×
35
def start_importing_transcript_task(video_id, msg, temp_vtt_file):
×
36
    """Start the import of transcription of the video."""
37
    from pod.video.models import Video
×
38
    from .transcript import save_vtt_and_notify
×
39
    from ..main.settings import MEDIA_ROOT
×
40

41
    print("Start the import of transcription of the video: %s" % video_id)
×
42
    print("temp_vtt_file: %s" % temp_vtt_file)
×
43
    video_to_encode = Video.objects.get(id=video_id)
×
44
    filename = os.path.basename(temp_vtt_file)
×
45
    media_temp_dir = os.path.join(MEDIA_ROOT, "temp")
×
46
    filepath = os.path.join(media_temp_dir, filename)
×
47
    new_vtt = webvtt.read(filepath)
×
48
    save_vtt_and_notify(video_to_encode, msg, new_vtt)
×
49
    os.remove(filepath)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc