From 75194838dafc8797883b5350ce48f8db69ea5c17 Mon Sep 17 00:00:00 2001 From: Olivier Bado-Faustin <12731381+Badatos@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:13:05 +0100 Subject: [PATCH] Code cleaning for 3.9.0 (#1238) * Remove useless html comments * Translate html comments * Remove duplicated function get_storage_path_video from video.utils * Replace '/' by os.path.join in video models * Remove duplicated code in video-script?html --- pod/live/templates/live/event-info.html | 3 ++- pod/main/templates/base.html | 3 +-- pod/main/templates/navbar.html | 2 +- .../playlist/playlist-list-modal.html | 4 ++-- pod/video/forms.py | 3 +-- pod/video/models.py | 4 ++-- .../templates/videos/video-all-info.html | 2 +- pod/video/templates/videos/video-element.html | 1 - pod/video/templates/videos/video-script.html | 3 --- pod/video/urls.py | 1 + pod/video/utils.py | 20 +------------------ pod/video_encode_transcript/models.py | 3 +-- 12 files changed, 13 insertions(+), 36 deletions(-) diff --git a/pod/live/templates/live/event-info.html b/pod/live/templates/live/event-info.html index aec2f1b631..7f3eb1b499 100644 --- a/pod/live/templates/live/event-info.html +++ b/pod/live/templates/live/event-info.html @@ -58,7 +58,8 @@

{% trans 'Type:' %}

- {% if event.is_draft == False or event.owner == request.user or request.user in event.additional_owners.all or request.user.is_superuser %} + {% if event.is_draft == False or event.owner == request.user or request.user in event.additional_owners.all or request.user.is_superuser %} + + {% block more_script %} diff --git a/pod/video/forms.py b/pod/video/forms.py index 3bc613f457..1f6c25762b 100644 --- a/pod/video/forms.py +++ b/pod/video/forms.py @@ -10,13 +10,12 @@ from django.utils.deconstruct import deconstructible from django.utils.translation import ugettext_lazy as _ from django.template.defaultfilters import filesizeformat -from .models import Video, VideoVersion +from .models import Video, VideoVersion, get_storage_path_video from .models import Channel from .models import Theme from .models import Type from .models import Discipline from .models import Notes, AdvancedNotes, NoteComments -from .utils import get_storage_path_video from pod.video_encode_transcript.models import PlaylistVideo from pod.video_encode_transcript import encode from pod.video_encode_transcript.models import EncodingVideo, EncodingAudio diff --git a/pod/video/models.py b/pod/video/models.py index d321beb881..9a7cada19a 100644 --- a/pod/video/models.py +++ b/pod/video/models.py @@ -262,9 +262,9 @@ def get_storage_path_video(instance, filename) -> str: return os.path.join( VIDEOS_DIR, instance.owner.owner.hashkey, - "%s/%s.%s" + os.path.dirname(fname), + "%s.%s" % ( - os.path.dirname(fname), slugify(os.path.basename(fname)), extension, ), diff --git a/pod/video/templates/videos/video-all-info.html b/pod/video/templates/videos/video-all-info.html index b5e406d266..cb65ee247a 100644 --- a/pod/video/templates/videos/video-all-info.html +++ b/pod/video/templates/videos/video-all-info.html @@ -17,7 +17,7 @@

{% endif %}
-