Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types to date preview & vod api #13636

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frigate/api/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ def vod_ts(camera_name, start_ts, end_ts):
)


@MediaBp.route("/vod/<year_month>/<day>/<hour>/<camera_name>")
@MediaBp.route("/vod/<year_month>/<int:day>/<int:hour>/<camera_name>")
@MediaBp.route("/vod/<year_month>/<float:day>/<float:hour>/<camera_name>")
def vod_hour_no_timezone(year_month, day, hour, camera_name):
return vod_hour(
year_month, day, hour, camera_name, get_localzone_name().replace("/", ",")
Expand Down
5 changes: 4 additions & 1 deletion frigate/api/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def preview_ts(camera_name, start_ts, end_ts):
return make_response(jsonify(clips), 200)


@PreviewBp.route("/preview/<year_month>/<day>/<hour>/<camera_name>/<tz_name>")
@PreviewBp.route("/preview/<year_month>/<int:day>/<int:hour>/<camera_name>/<tz_name>")
@PreviewBp.route(
"/preview/<year_month>/<float:day>/<float:hour>/<camera_name>/<tz_name>"
)
def preview_hour(year_month, day, hour, camera_name, tz_name):
parts = year_month.split("-")
start_date = (
Expand Down