mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
fix: handle multi-word timezones (#4816)
This commit is contained in:
parent
6e519e0071
commit
ffd637cc0c
@ -1088,14 +1088,14 @@ def vod_ts(camera_name, start_ts, end_ts):
|
|||||||
@bp.route("/vod/<year_month>/<day>/<hour>/<camera_name>")
|
@bp.route("/vod/<year_month>/<day>/<hour>/<camera_name>")
|
||||||
def vod_hour_no_timezone(year_month, day, hour, camera_name):
|
def vod_hour_no_timezone(year_month, day, hour, camera_name):
|
||||||
return vod_hour(
|
return vod_hour(
|
||||||
year_month, day, hour, camera_name, get_localzone_name().replace("/", "_")
|
year_month, day, hour, camera_name, get_localzone_name().replace("/", ",")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# TODO make this nicer when vod module is removed
|
# TODO make this nicer when vod module is removed
|
||||||
@bp.route("/vod/<year_month>/<day>/<hour>/<camera_name>/<tz_name>")
|
@bp.route("/vod/<year_month>/<day>/<hour>/<camera_name>/<tz_name>")
|
||||||
def vod_hour(year_month, day, hour, camera_name, tz_name):
|
def vod_hour(year_month, day, hour, camera_name, tz_name):
|
||||||
tz_name = tz_name.replace("_", "/")
|
tz_name = tz_name.replace(",", "/")
|
||||||
parts = year_month.split("-")
|
parts = year_month.split("-")
|
||||||
start_date = datetime(
|
start_date = datetime(
|
||||||
int(parts[0]), int(parts[1]), int(day), int(hour), tzinfo=pytz.timezone(tz_name)
|
int(parts[0]), int(parts[1]), int(day), int(hour), tzinfo=pytz.timezone(tz_name)
|
||||||
|
@ -71,7 +71,7 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
|
|||||||
{
|
{
|
||||||
src: `${apiHost}vod/${year}-${month}/${day}/${h.hour}/${camera}/${timezone.replaceAll(
|
src: `${apiHost}vod/${year}-${month}/${day}/${h.hour}/${camera}/${timezone.replaceAll(
|
||||||
'/',
|
'/',
|
||||||
'_'
|
','
|
||||||
)}/master.m3u8`,
|
)}/master.m3u8`,
|
||||||
type: 'application/vnd.apple.mpegurl',
|
type: 'application/vnd.apple.mpegurl',
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user