ADD list command to CLI for displaying all markers

This commit is contained in:
2025-12-18 20:17:54 +00:00
parent 3c870c7a69
commit 143f4e0c8d
2 changed files with 41 additions and 17 deletions

View File

@@ -80,11 +80,24 @@ def mark(name: str) -> None:
"name": name,
"timestamp": datetime.datetime.now().timestamp()
})
with open(markers_file, "w") as f:
json.dump(markers, f, indent=4)
print(f"Added marker: {name}")
def print_markers() -> None:
markers_file = os.path.join(os.path.dirname(__file__), "markers.json")
if not os.path.exists(markers_file):
print("No markers found.")
return
with open(markers_file, "r") as f:
markers = json.load(f)
for marker in markers:
format_time = datetime.datetime.fromtimestamp(marker['timestamp']).strftime('%Y-%m-%d %H:%M:%S')
print(f"{format_time} -> {marker['name']}")
def get_duration(file_path: str) -> float:
result = subprocess.run(
["ffprobe", "-v", "error", "-show_entries",