Files
FishServer/fish_api/app/services/water_video.py
2026-04-16 14:53:01 +08:00

26 lines
938 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""水上视频:返回与最近投递的 health 快照对齐的视频 URL。
视频由 action_watch 在推理完成后统一发布到 MEDIA_ROOTURL 存储在
health_snapshots.video_url 列中,确保 /health/result/ 与 /water/video/
两个端点始终返回同一切片的结果。
"""
from __future__ import annotations
from app.db import peek_last_delivered_health_video_url
from app.settings import Settings
DEFAULT_CLIENT_ID = "default"
async def get_water_video_public_url(
settings: Settings, client_id: str = DEFAULT_CLIENT_ID,
) -> str:
"""返回该客户端上一次 ``/health/result/`` 投递的切片视频 URL。
视频文件在 ``action_watch`` 推理完成后即发布到 ``MEDIA_ROOT`` 并将 URL
写入 ``health_snapshots.video_url``;本函数仅做一次 DB 查询,不再独立
解析源文件或切片。
"""
return peek_last_delivered_health_video_url(settings, client_id)