Update cursor_tracker.py
Browse files- cursor_tracker.py +7 -3
cursor_tracker.py
CHANGED
|
@@ -80,7 +80,7 @@ def log_message(message: str):
|
|
| 80 |
def log_failed_file(filename: str, error: str):
|
| 81 |
"""Log failed files to persistent file"""
|
| 82 |
with open(FAILED_FILES_LOG, "a") as f:
|
| 83 |
-
f.write(f"{time.strftime(
|
| 84 |
|
| 85 |
def get_disk_usage(path: str) -> Dict[str, float]:
|
| 86 |
"""Get disk usage statistics in GB"""
|
|
@@ -480,7 +480,7 @@ def process_rar_file(rar_path: str) -> bool:
|
|
| 480 |
finally:
|
| 481 |
processing_status["current_file"] = None
|
| 482 |
|
| 483 |
-
def main_processing_loop():
|
| 484 |
"""Main processing workflow - extraction, frame extraction, and cursor tracking"""
|
| 485 |
processing_status["is_running"] = True
|
| 486 |
|
|
@@ -488,7 +488,9 @@ def main_processing_loop():
|
|
| 488 |
# Load state
|
| 489 |
processed_rars = load_json_state(PROCESS_STATE_FILE, {"processed_rars": []})["processed_rars"]
|
| 490 |
download_state = load_json_state(DOWNLOAD_STATE_FILE, {"next_download_index": 0})
|
| 491 |
-
|
|
|
|
|
|
|
| 492 |
|
| 493 |
log_message(f"π Starting from index {next_index}")
|
| 494 |
log_message(f"π Previously processed: {len(processed_rars)} files")
|
|
@@ -595,3 +597,5 @@ __all__ = [
|
|
| 595 |
]
|
| 596 |
|
| 597 |
|
|
|
|
|
|
|
|
|
| 80 |
def log_failed_file(filename: str, error: str):
|
| 81 |
"""Log failed files to persistent file"""
|
| 82 |
with open(FAILED_FILES_LOG, "a") as f:
|
| 83 |
+
f.write(f"{time.strftime("%Y-%m-%d %H:%M:%S")} - {filename}: {error}\n")
|
| 84 |
|
| 85 |
def get_disk_usage(path: str) -> Dict[str, float]:
|
| 86 |
"""Get disk usage statistics in GB"""
|
|
|
|
| 480 |
finally:
|
| 481 |
processing_status["current_file"] = None
|
| 482 |
|
| 483 |
+
def main_processing_loop(start_index: int = 0):
|
| 484 |
"""Main processing workflow - extraction, frame extraction, and cursor tracking"""
|
| 485 |
processing_status["is_running"] = True
|
| 486 |
|
|
|
|
| 488 |
# Load state
|
| 489 |
processed_rars = load_json_state(PROCESS_STATE_FILE, {"processed_rars": []})["processed_rars"]
|
| 490 |
download_state = load_json_state(DOWNLOAD_STATE_FILE, {"next_download_index": 0})
|
| 491 |
+
|
| 492 |
+
# Use start_index if provided, otherwise use the saved state
|
| 493 |
+
next_index = start_index if start_index > 0 else download_state["next_download_index"]
|
| 494 |
|
| 495 |
log_message(f"π Starting from index {next_index}")
|
| 496 |
log_message(f"π Previously processed: {len(processed_rars)} files")
|
|
|
|
| 597 |
]
|
| 598 |
|
| 599 |
|
| 600 |
+
|
| 601 |
+
|