Add /api/rescan endpoint, header rescan button, 30s auto-poll for new files
This commit is contained in:
@@ -111,6 +111,11 @@ class PlayerHandler(BaseHTTPRequestHandler):
|
||||
|
||||
def do_POST(self):
|
||||
path = urlparse(self.path).path
|
||||
if path == "/api/rescan":
|
||||
self.server.recordings = scan_recordings(self.server.output_root)
|
||||
self.server.system_highlights = scan_system_highlights(self.server.source_root)
|
||||
count = sum(map(len, self.server.recordings.values()))
|
||||
return self.send_json({"ok": True, "days": len(self.server.recordings), "clips": count})
|
||||
if path == "/api/upload":
|
||||
return self.handle_upload()
|
||||
if path == "/api/encode":
|
||||
|
||||
Reference in New Issue
Block a user