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

EsupPortail / Esup-Pod / 5462629459

pending completion
5462629459

Pull #899

github

web-flow
Merge e759dacb6 into c94f0e331
Pull Request #899: [DONE] Ptitloup/feature new encoding

400 of 400 new or added lines in 14 files covered. (100.0%)

8968 of 12675 relevant lines covered (70.75%)

0.71 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
from celery import Celery
×
2
try:
×
3
    from ..custom import settings_local
×
4
except ImportError:
×
5
    from .. import settings as settings_local
×
6
import logging
×
7
import os
×
8
import webvtt
×
9
logger = logging.getLogger(__name__)
×
10

11
ENCODING_TRANSCODING_CELERY_BROKER_URL = getattr(
×
12
    settings_local,
13
    "ENCODING_TRANSCODING_CELERY_BROKER_URL",
14
    ""
15
)
16

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

27

28
# celery \
29
# -A pod.video_encode_transcript.importing_transcript_tasks worker \
30
# -l INFO -Q importing_transcript
31
@importing_transcript_app.task
×
32
def start_importing_transcript_task(video_id, msg, temp_vtt_file):
×
33
    """Start the import of transcription of the video."""
34
    from pod.video.models import Video
×
35
    from .transcript import save_vtt_and_notify
×
36
    from ..main.settings import MEDIA_ROOT
×
37
    print("Start the import of transcription of the video: %s" % video_id)
×
38
    print("temp_vtt_file: %s" % temp_vtt_file)
×
39
    video_to_encode = Video.objects.get(id=video_id)
×
40
    filename = os.path.basename(temp_vtt_file)
×
41
    media_temp_dir = os.path.join(MEDIA_ROOT, "temp")
×
42
    filepath = os.path.join(media_temp_dir, filename)
×
43
    new_vtt = webvtt.read(filepath)
×
44
    save_vtt_and_notify(video_to_encode, msg, new_vtt)
×
45
    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