Add types to date preview & vod api (#13636)

* Add types to date preview api

* Formatting
This commit is contained in:
Nicolas Mowen 2024-09-09 10:03:53 -06:00 committed by GitHub
parent f143fceceb
commit f5dbcd5465
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -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("/", ",")

View File

@ -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 = (