Polish camera settings layout and close media error responses

This commit is contained in:
Codex
2026-10-04 04:58:56 +08:00
parent 96f0ef31fc
commit 14f722fa69
6 changed files with 29 additions and 10 deletions
+8 -7
View File
@@ -343,13 +343,14 @@ def media_json(path, playback=False):
with urllib.request.urlopen(req, timeout=5) as r:
return json.load(r)
except urllib.error.HTTPError as exc:
if playback and path.startswith('/list?') and exc.code == 404:
try:
detail = json.loads(exc.read(4096))
if detail.get('error') == 'no recording segments found':
return []
except (ValueError, AttributeError):
pass
with exc:
if playback and path.startswith('/list?') and exc.code == 404:
try:
detail = json.loads(exc.read(4096))
if detail.get('error') == 'no recording segments found':
return []
except (ValueError, AttributeError):
pass
raise Problem('视频服务暂不可用,或该时段尚无可回放录像', 503)
except Exception:
raise Problem('视频服务暂不可用,或该时段尚无可回放录像', 503)