Skip to content
Snippets Groups Projects
Commit 36ac2a12 authored by Julian Rother's avatar Julian Rother
Browse files

Small cleanup

parent dcb0516d
No related branches found
No related tags found
No related merge requests found
......@@ -226,7 +226,9 @@ def sort_now():
for mountpoint in config['VIDEOMOUNT']:
existingvideos = query('SELECT videos.path FROM videos JOIN lectures ON (videos.lecture_id = lectures.id) WHERE lectures.course_id = ?',course['id'])
knownerrors = query('SELECT sorterrorlog.path FROM sorterrorlog WHERE sorterrorlog.course_id = ?',course['id'])
ignorefiles = existingvideos + knownerrors
ignorefiles = []
for path in existingvideos + knownerrors:
ignorefiles.append(os.path.basename(path))
lectures = query('SELECT * from lectures where course_id = ?',course['id'])
coursepath = mountpoint['mountpoint']+course['handle']
try:
......@@ -236,14 +238,7 @@ def sort_now():
for filename in files:
try:
# if the video is in the table "videos" already (with the correct course), skip it
ignore = False
for file_to_ignore in ignorefiles:
# path is something like
# vpnonline/08ws-swt/08ws-swt-081118.mp4
if os.path.basename(filename) == os.path.basename(file_to_ignore['path']):
ignore = True
break
if ignore:
if os.path.basename(filename) in ignorefiles:
continue
if not os.path.splitext(filename)[1] == '.mp4':
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment