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

EsupPortail / Esup-Pod / 5424527746

pending completion
5424527746

Pull #899

github

web-flow
Merge 83465db1d into b8d45a116
Pull Request #899: [WIP] Ptitloup/feature new encoding

341 of 341 new or added lines in 8 files covered. (100.0%)

9029 of 12634 relevant lines covered (71.47%)

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
from .. import settings
×
3
import logging
×
4
import io
×
5
import webvtt
×
6
logger = logging.getLogger(__name__)
×
7

8
ENCODING_TRANSCODING_CELERY_BROKER_URL = getattr(
×
9
    settings,
10
    "ENCODING_TRANSCODING_CELERY_BROKER_URL",
11
    ""
12
)
13

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

24

25
# celery \
26
# -A pod.video_encode_transcript.importing_transcript_tasks worker \
27
# -l INFO -Q importing_transcript
28
@importing_transcript_app.task
×
29
def start_importing_transcript_task(video_id, msg, textwebvtt):
×
30
    """Start the encoding of the video."""
31
    print("Start the importing transcript of the video ID : %s" % video_id)
×
32
    from pod.video.models import Video
×
33
    from .transcript import save_vtt_and_notify
×
34
    video_to_encode = Video.objects.get(id=video_id)
×
35
    textwebvtt = "WEBVTT\\n\\n" + textwebvtt
×
36
    f = io.StringIO(textwebvtt)
×
37
    new_vtt = webvtt.read_buffer(f)
×
38
    save_vtt_and_notify(video_to_encode, msg, new_vtt)
×
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