MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / peer_session

Function peer_session

src/astroprint/api/camera.py:79–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77@api.route("/camera/peer-session", methods=["POST", "DELETE"])
78@restricted_access
79def peer_session():
80 data = request.json
81 if data and 'sessionId' in data:
82 sessionId = data['sessionId']
83
84 if request.method == 'POST':
85 #Initialize the peer session
86 if cameraManager().startLocalVideoSession(sessionId):
87 return jsonify(SUCCESS)
88
89 abort(500)
90
91 elif request.method == 'DELETE':
92 #Close peer session
93 if cameraManager().closeLocalVideoSession(sessionId):
94 return jsonify(SUCCESS)
95
96 else:
97 abort(500)
98
99 else:
100 abort(400)

Callers

nothing calls this directly

Calls 3

cameraManagerFunction · 0.90

Tested by

no test coverage detected