Files
FishServer/fish_api/app/services/water_video.py

26 lines
938 B
Python
Raw Normal View History

"""水上视频:返回与最近投递的 health 快照对齐的视频 URL。
2026-04-13 17:13:02 +08:00
视频由 action_watch 在推理完成后统一发布到 MEDIA_ROOTURL 存储在
health_snapshots.video_url 列中确保 /health/result/ /water/video/
两个端点始终返回同一切片的结果
2026-04-13 17:13:02 +08:00
"""
2026-04-13 14:50:44 +08:00
from __future__ import annotations
from app.db import peek_last_delivered_health_video_url
2026-04-13 14:50:44 +08:00
from app.settings import Settings
2026-04-13 17:13:02 +08:00
DEFAULT_CLIENT_ID = "default"
2026-04-13 14:50:44 +08:00
async def get_water_video_public_url(
settings: Settings, client_id: str = DEFAULT_CLIENT_ID,
2026-04-13 17:13:02 +08:00
) -> str:
"""返回该客户端上一次 ``/health/result/`` 投递的切片视频 URL。
2026-04-13 17:13:02 +08:00
视频文件在 ``action_watch`` 推理完成后即发布到 ``MEDIA_ROOT`` 并将 URL
写入 ``health_snapshots.video_url``本函数仅做一次 DB 查询不再独立
解析源文件或切片
2026-04-13 17:13:02 +08:00
"""
return peek_last_delivered_health_video_url(settings, client_id)