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

Small cleanup

parent dcb0516d
Branches
No related tags found
No related merge requests found
...@@ -226,7 +226,9 @@ def sort_now(): ...@@ -226,7 +226,9 @@ def sort_now():
for mountpoint in config['VIDEOMOUNT']: 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']) 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']) 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']) lectures = query('SELECT * from lectures where course_id = ?',course['id'])
coursepath = mountpoint['mountpoint']+course['handle'] coursepath = mountpoint['mountpoint']+course['handle']
try: try:
...@@ -236,14 +238,7 @@ def sort_now(): ...@@ -236,14 +238,7 @@ def sort_now():
for filename in files: for filename in files:
try: try:
# if the video is in the table "videos" already (with the correct course), skip it # if the video is in the table "videos" already (with the correct course), skip it
ignore = False if os.path.basename(filename) in ignorefiles:
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:
continue continue
if not os.path.splitext(filename)[1] == '.mp4': if not os.path.splitext(filename)[1] == '.mp4':
continue continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment