fix: save output now takes timestamp of inital marker

This commit is contained in:
2026-02-01 03:05:10 +00:00
parent 12aaef0673
commit 4a16733362

View File

@@ -31,14 +31,12 @@ def save(first_marker: str, second_marker: str):
vod_dir = os.path.expanduser(load_config()["record"]["vod_output"])
os.makedirs(vod_dir, exist_ok=True)
output_file_name = f"{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}-[{first_marker}-{second_marker}].mp4"
output_path = os.path.join(vod_dir, output_file_name)
print(output_path)
first_timestamp = get_marker_timestamp(first_marker)
second_timestamp = get_marker_timestamp(second_marker)
output_file_name = f"{datetime.datetime.fromtimestamp(first_timestamp).strftime('%Y-%m-%d_%H:%M:%S')}-[{first_marker}-{second_marker}].mp4"
output_path = os.path.join(vod_dir, output_file_name)
if first_timestamp >= second_timestamp:
raise ValueError("First marker must be before second marker")