Skip to content
Snippets Groups Projects
Commit 077703e9 authored by Andreas Valder's avatar Andreas Valder
Browse files

fixed sorter

parent fd0b6bb1
Branches
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ def sort_now():
filepath = coursepath + '/' + f
# filenames: <handle>-<sorter>-<format>.mp4
# sorter musst be found with fuzzy matching. musst be one or more of the following: (inside the loop)
splitfilename = f.split('-')
splitfilename = f.replace('_','-').split('-')
if not os.path.splitext(f)[1] == '.mp4':
continue
data = {'keywords': []}
......@@ -105,10 +105,9 @@ def sort_now():
# if we found the format, insert the video
if 'format' in data:
modify('BEGIN')
video_id = modify('INSERT INTO videos_data (lecture_id,visible,path,video_format,title,comment,internal,file_modified,time_created,time_updated,created_by,hash) VALUES (?,0,?,?,"","","",?,?,?,?,"")',matches[0]['id'],c['handle']+'/'+f,data['format'],datetime.now(),datetime.now(),datetime.now(),session['user']['givenName'])
video_id = modify('INSERT INTO videos_data (lecture_id,visible,path,video_format,title,comment,internal,file_modified,time_created,time_updated,created_by,hash,file_size) VALUES (?,0,?,?,"","","",?,?,?,?,"",?)',matches[0]['id'],c['handle']+'/'+f,data['format'],datetime.now(),datetime.now(),datetime.now(),session['user']['givenName'],os.stat(coursepath+'/'+f).st_size)
query('INSERT INTO sortlog (lecture_id,video_id,path,`when`) VALUES (?,?,?,?)',matches[0]['id'],video_id,c['handle']+'/'+f,datetime.now())
modify('COMMIT')
print('sorted',[data,f])
else:
print('unknown format',formatstring,[data,f])
else:
......
......@@ -72,7 +72,6 @@ var moderator = {
editbtnclick: function (src) {
var path = $($(src)[0]).data('path');
var value = $('.editor_value',src.parentElement.parentElement).val();
// var value = $(".editor_value")[0].value;
var editable = $('.moderator_editor');
for (var i=0; i<editable.length; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment