This commit is contained in:
Eric Lay 2024-03-27 20:27:59 -05:00
parent 381d8c28ef
commit 1cfb5f7535
1 changed files with 4 additions and 4 deletions

8
app.py
View File

@ -18,15 +18,15 @@ website_dir = None
def current_website_dir(): def current_website_dir():
session.pop('website_dir', None) session.pop('website_dir', None)
if session['requests'] % 5 == 0: if session['requests'] % 5 == 0:
session['website_dir'] = str(ROOT_DIR+"/Marvel") session['website_dir'] = (os.path.join(ROOT_DIR, 'Marvel'))
elif session['requests'] % 6 == 0: elif session['requests'] % 6 == 0:
session['website_dir'] = str(ROOT_DIR+"/Escape") session['website_dir'] = (os.path.join(ROOT_DIR, 'Escape'))
session.pop('requests', None) session.pop('requests', None)
else: else:
global WEBSITE_DIRS global WEBSITE_DIRS
try: try:
WEBSITE_DIRS.remove(os.path.isdir(os.path.join(ROOT_DIR, 'Escape'))) WEBSITE_DIRS.remove(os.path.join(ROOT_DIR, 'Marvel'))
WEBSITE_DIRS.remove(os.path.isdir(os.path.join(ROOT_DIR, 'Marvel'))) WEBSITE_DIRS.remove(os.path.join(ROOT_DIR, 'Escape'))
except (ValueError, IndexError) as e: except (ValueError, IndexError) as e:
pass pass
session['website_dir'] = random.choice(WEBSITE_DIRS) session['website_dir'] = random.choice(WEBSITE_DIRS)