move randomization

This commit is contained in:
Gordon Shumway 2019-06-16 09:41:13 -04:00 committed by GitHub
parent 3677f1e40e
commit fc34ae1c62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,7 +183,7 @@ class Jeopardy(callbacks.Plugin):
data.extend(requests.get("http://jservice.io/api/clues?&category={0}&offset=400".format(category)).json()) data.extend(requests.get("http://jservice.io/api/clues?&category={0}&offset=400".format(category)).json())
if cluecount > 500: if cluecount > 500:
data.extend(requests.get("http://jservice.io/api/clues?&category={0}&offset=500".format(category)).json()) data.extend(requests.get("http://jservice.io/api/clues?&category={0}&offset=500".format(category)).json())
if cluecount > 9: if self.registryValue('randomize', channel):
random.shuffle(data) random.shuffle(data)
for item in data: for item in data:
if n > self.num or k > len(self.categories): if n > self.num or k > len(self.categories):
@ -207,8 +207,6 @@ class Jeopardy(callbacks.Plugin):
except Exception: except Exception:
pass pass
del data del data
if self.registryValue('randomize', channel):
random.shuffle(self.questions)
try: try:
schedule.removeEvent('next_%s' % self.channel) schedule.removeEvent('next_%s' % self.channel)
except KeyError: except KeyError: