Fleet Manager: Fix Screen Recorder list generation

This commit is contained in:
Jason Wen
2024-02-17 16:30:53 -05:00
parent 8cbfae6eff
commit 25246b1b71
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ def footage():
@app.route("/screenrecords")
@fleet.login_required
def screenrecords():
rows = fleet.list_files(fleet.SCREENRECORD_PATH)
rows = fleet.list_files(fleet.SCREENRECORD_PATH, True)
if not rows:
return render_template("error.html", error="no screenrecords found at:<br><br>" + fleet.SCREENRECORD_PATH)
return render_template("screenrecords.html", rows=rows, clip=rows[0])
+3 -2
View File
@@ -31,8 +31,9 @@ def login_required(f):
return decorated_route
def list_files(path):
return sorted(listdir_by_creation(path), reverse=True)
def list_files(path, single=False):
files = os.listdir(path) if single else listdir_by_creation(path)
return sorted(files, reverse=True)
def is_valid_segment(segment):