Refactor to prevent secretariat recordings entry page from timing out. Fixes #2287. Commit ready for merge

- Legacy-Id: 13275
This commit is contained in:
Ryan Cross 2017-05-08 22:13:50 +00:00
parent 6b7bb57597
commit 462fc1a2e5

View file

@ -77,8 +77,11 @@ def get_unmatched_recordings(meeting):
files = os.listdir(path)
except OSError:
files = []
url = settings.IETF_AUDIO_URL + 'ietf%s' % meeting.number
recordings = Document.objects.filter(type='recording',external_url__startswith=url)
filenames = [ d.external_url.split('/')[-1] for d in recordings ]
for file in files:
if not Document.objects.filter(external_url__endswith=file).exists():
if file not in filenames:
unmatched_recordings.append(file)
return unmatched_recordings