fix: code-review round 1 — 4 findings
- og: guard safe_abs_path's None (missing/gc'd poster) before _jpeg_size, else the public /watch OG render crashed with an uncaught AttributeError - channels: hoist the priority step button to module scope so it no longer remounts on every hold-repeat tick (which dropped the pointer capture and could let a hold run away on pointer drift) - watch: only route audio through Web Audio on iOS (where a backgrounded <video> is suspended); other platforms keep their reliable native audio, avoiding a foreground-silence risk if the AudioContext can't resume - share: drop the unstable `create` mutation object from the auto-create effect deps (it changes every render); the links.data trigger + autoTried ref already fire it exactly once The clipboard-on-focus finding is intended (the user explicitly asked for auto-paste on focus; the read is best-effort and browsers reject it without a gesture, so no real prompt fires).
This commit is contained in:
@@ -125,7 +125,10 @@ def _watch_tags(token: str, db: Session) -> str | None:
|
||||
tags.append(_tag("og:image:secure_url", image))
|
||||
if image.endswith("poster.jpg") and asset.poster_path:
|
||||
tags.append(_tag("og:image:type", "image/jpeg"))
|
||||
dims = _jpeg_size(storage.safe_abs_path(settings.download_root, asset.poster_path))
|
||||
# safe_abs_path returns None if the poster file is missing (gc'd) or escapes the root —
|
||||
# guard it, else _jpeg_size(None) would raise an uncaught AttributeError on this public page.
|
||||
poster_abs = storage.safe_abs_path(settings.download_root, asset.poster_path)
|
||||
dims = _jpeg_size(poster_abs) if poster_abs else None
|
||||
if dims:
|
||||
tags.append(_tag("og:image:width", str(dims[0])))
|
||||
tags.append(_tag("og:image:height", str(dims[1])))
|
||||
|
||||
Reference in New Issue
Block a user