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

EsupPortail / Esup-Pod / 5963217109

24 Aug 2023 11:41AM UTC coverage: 70.8% (-0.07%) from 70.873%
5963217109

push

github

web-flow
[DONE] Update : Displaying channels via AJAX (#910)

* Add requests to get the channel lists in JSON format

* Add requests to get the channel lists in JSON format

* Add JS functions to make AJAX request to get channel lists

* Use the AJAX request to load the channels when the user ask to view it only

* Remove channel constants in the context_processors

* Add infine loader for the default channels

* Replace 'concert' by 'convert' in the function name

* Fix the theme list in the channel page

* Add list group for the theme list in the navbar

* Add the setAttributesWithTab function

* Move the headband to the right

* Hide the channel tabs when HIDE_CHANNEL_TAB is true

* Update test units

* Add infinite loader for channels in channel tabs

* Add unit tests

* Fix flake8 & add JS doc

* Add the translations

* Fix duplicate display of channels in navbar

* Add loading element when the channel list loading isn't done

* Add themes loader & CHANNELS_PER_BATCH settings & fix unit tests

* Fix translation for 'Channels'

* Fix translation

* Move styling in pod.css

* Fix flake8

* remove unused code in base.html, update get_list to only show children if wanted, move js code to video_edit from main, update channel to shwo theme and view to send all channels and theme in video edit

* remove duplicate code - improve bdd request

* fix unit test and bug if no channels in video form

---------

Co-authored-by: Ptitloup <nicolas.can@univ-lille.fr>

52 of 52 new or added lines in 6 files covered. (100.0%)

9056 of 12791 relevant lines covered (70.8%)

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

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

11
logger = logging.getLogger(__name__)
×
12

13
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pod.settings")
×
14

15
ENCODING_TRANSCODING_CELERY_BROKER_URL = getattr(
×
16
    settings_local, "ENCODING_TRANSCODING_CELERY_BROKER_URL", ""
17
)
18

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

28

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

39
    print("Start the import of transcription of the video: %s" % video_id)
×
40
    print("temp_vtt_file: %s" % temp_vtt_file)
×
41
    video_to_encode = Video.objects.get(id=video_id)
×
42
    filename = os.path.basename(temp_vtt_file)
×
43
    media_temp_dir = os.path.join(MEDIA_ROOT, "temp")
×
44
    filepath = os.path.join(media_temp_dir, filename)
×
45
    new_vtt = webvtt.read(filepath)
×
46
    save_vtt_and_notify(video_to_encode, msg, new_vtt)
×
47
    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