Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DONE] New 3.4.0 fixes #981

Merged
merged 5 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pod/video/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,8 @@ def __init__(self, *args, **kwargs):

if self.instance and self.instance.video:
if self.instance.encoding_in_progress or not self.instance.encoded:
self.remove_field("owner")
if not self.is_superuser:
self.remove_field("owner")
self.remove_field("video") # .widget = forms.HiddenInput()

# remove required=True for videofield if instance
Expand Down
4 changes: 2 additions & 2 deletions pod/video/management/commands/create_thumbnail.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.core.management.base import BaseCommand
from pod.video.models import Video
from pod.video.Encoding_video_model import Encoding_video_model
from pod.video.models import EncodingLog
from pod.video_encode_transcript.Encoding_video_model import Encoding_video_model
from pod.video_encode_transcript.models import EncodingLog


class Command(BaseCommand):
Expand Down
20 changes: 12 additions & 8 deletions pod/video/static/js/video_stats_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,25 @@ $(() => {
pager: "#pager",
sortorder: "asc",
beforeProcessing: function (data) {
// Set min date
let min_date = data.filter((obj) => {
return obj.min_date != undefined;
});
// remove date_min in data
data.pop();
document.querySelector("#jsperiode").min = min_date[0].min_date;
// Avoid "data.filter is not a function" error (if change number of lines or page)
try {
Badatos marked this conversation as resolved.
Show resolved Hide resolved
// Set min date
let min_date = data.filter((obj) => {
return obj.min_date != undefined;
});
// remove date_min in data
data.pop();
document.getElementById("jsperiode").min = min_date[0].min_date;
}
catch(uselesserr) { }
},
postData: {
csrfmiddlewaretoken: $("[name=csrfmiddlewaretoken]").val(),
},
});
let today = new Date().toISOString().split("T")[0];
$("#jsperiode").val(today); // set date input value to today
SebastienCozeDev marked this conversation as resolved.
Show resolved Hide resolved
document.querySelector("#jsperiode").max = today;
document.getElementById("jsperiode").max = today;

$("#jsperiode").on("change paste keyup", function (e) {
SebastienCozeDev marked this conversation as resolved.
Show resolved Hide resolved
if ($(this).val() != undefined && $(this).val().trim() !== "") {
Expand Down
2 changes: 1 addition & 1 deletion pod/video_encode_transcript/Encoding_video_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def recreate_thumbnail(self):
encoding_log.save()
if len(self.list_thumbnail_files) > 0:
info_video["list_thumbnail_files"] = self.list_thumbnail_files
self.store_json_list_thumbnail_files(info_video, video_to_encode)
self.store_json_list_thumbnail_files(info_video)

def encode_video(self):
"""Start video encoding."""
Expand Down