mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Write files in UTC and update folder structure to not conflict
This commit is contained in:
parent
739a267462
commit
fc39faa87b
@ -261,8 +261,8 @@ class RecordingMaintainer(threading.Thread):
|
|||||||
def store_segment(
|
def store_segment(
|
||||||
self,
|
self,
|
||||||
camera,
|
camera,
|
||||||
start_time,
|
start_time: datetime.datetime,
|
||||||
end_time,
|
end_time: datetime.datetime,
|
||||||
duration,
|
duration,
|
||||||
cache_path,
|
cache_path,
|
||||||
store_mode: RetainModeEnum,
|
store_mode: RetainModeEnum,
|
||||||
@ -277,12 +277,12 @@ class RecordingMaintainer(threading.Thread):
|
|||||||
self.end_time_cache.pop(cache_path, None)
|
self.end_time_cache.pop(cache_path, None)
|
||||||
return
|
return
|
||||||
|
|
||||||
directory = os.path.join(RECORD_DIR, start_time.strftime("%Y-%m/%d/%H"), camera)
|
directory = os.path.join(RECORD_DIR, start_time.replace(tzinfo=datetime.timezone.utc).strftime("%Y-%m-%d/%H"), camera)
|
||||||
|
|
||||||
if not os.path.exists(directory):
|
if not os.path.exists(directory):
|
||||||
os.makedirs(directory)
|
os.makedirs(directory)
|
||||||
|
|
||||||
file_name = f"{start_time.strftime('%M.%S.mp4')}"
|
file_name = f"{start_time.replace(tzinfo=datetime.timezone.utc).strftime('%M.%S.mp4')}"
|
||||||
file_path = os.path.join(directory, file_name)
|
file_path = os.path.join(directory, file_name)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user