Skip app startup screens with warmup logic
- Added warmup counter to skip first 3 steps after entering app - Reset counter when leaving target app - Prevents recording splash screens as videos Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -242,6 +242,10 @@ class VideoLearningAgent:
|
||||
# Video detection: track screenshot changes (simplified)
|
||||
self._last_screenshot_hash: Optional[str] = None
|
||||
|
||||
# Skip app startup screens
|
||||
self._in_app_steps: int = 0
|
||||
self._warmup_steps: int = 3 # Skip first 3 steps after entering app
|
||||
|
||||
# Screenshot analyzer for content extraction
|
||||
self._analyzer: Optional[ScreenshotAnalyzer] = None
|
||||
try:
|
||||
@@ -405,7 +409,15 @@ class VideoLearningAgent:
|
||||
is_in_target = any(pkg.lower() in current_app.lower() for pkg in packages)
|
||||
|
||||
if not is_in_target:
|
||||
print(f"[VideoLearning] Not in target app: {current_app} (step {result.step_count})")
|
||||
# Reset warmup counter when leaving app
|
||||
self._in_app_steps = 0
|
||||
print(f"[VideoLearning] Not in target app: {current_app}")
|
||||
return None
|
||||
|
||||
# Warmup: skip first few steps to avoid startup screens
|
||||
self._in_app_steps += 1
|
||||
if self._in_app_steps <= self._warmup_steps:
|
||||
print(f"[VideoLearning] Warmup step {self._in_app_steps}/{self._warmup_steps}, skipping...")
|
||||
return None
|
||||
|
||||
# Get screenshot
|
||||
|
||||
Reference in New Issue
Block a user