diff --git a/app/routes.py b/app/routes.py index 7c0fb47..ab7d9b0 100644 --- a/app/routes.py +++ b/app/routes.py @@ -128,6 +128,10 @@ def files(path): render_files = [] if os.path.exists(current_path): render_files = get_files_in_path(current_path) + filenames = [x['name'] for x in render_files] + if 'index.html' in filenames: + index_path = render_files[filenames.index('index.html')]['path'] + return redirect(url_for('serve_file', filepath=index_path)) else: return redirect(url_for('files', path="")) return render_template('usb-file-viewer.html', title='File Viewer', current_path=current_path, render_files=render_files, get_setting=get_setting)