mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-06 06:45:40 +08:00
Fleet Manager: Fix Screen Recorder list generation
This commit is contained in:
@@ -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])
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user