diff --git a/sorter.py b/sorter.py index 7a6f78f4429ba51a9eabb3d5f6cc9c2b08e9f3de..0638dcd74d236b82c8655d573d21dc9befe7a64c 100644 --- a/sorter.py +++ b/sorter.py @@ -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: diff --git a/static/moderator.js b/static/moderator.js index 390d49daaec05c9fd8bbef86891837b1ecfb3d66..d606f46a14e630927455afb223ccc6a702d067d1 100644 --- a/static/moderator.js +++ b/static/moderator.js @@ -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++) {