fixedbugs

This commit is contained in:
bnair
2026-01-03 14:35:59 +01:00
parent 51fc7e12bc
commit d5bcaf16ee
2 changed files with 21 additions and 11 deletions

File diff suppressed because one or more lines are too long

View File

@@ -259,7 +259,8 @@ def worker_wrapper(worker_id, file_path, category, lock_dir, log_dir, encoders,
dashboard.update_worker(worker_id, "Idle", "Waiting", "dim") dashboard.update_worker(worker_id, "Idle", "Waiting", "dim")
# --- Monitor --- # --- Monitor ---
class WatcherHandler(FileSystemEventHandler): if HAS_WATCHDOG:
class WatcherHandler(FileSystemEventHandler):
def __init__(self, queue): def __init__(self, queue):
self.queue = queue self.queue = queue
def on_created(self, event): def on_created(self, event):
@@ -268,6 +269,11 @@ class WatcherHandler(FileSystemEventHandler):
def on_moved(self, event): def on_moved(self, event):
if not event.is_directory and event.dest_path.lower().endswith(('.mkv', '.mp4')): if not event.is_directory and event.dest_path.lower().endswith(('.mkv', '.mp4')):
self.queue.put(Path(event.dest_path)) self.queue.put(Path(event.dest_path))
else:
# Dummy class when watchdog not available
class WatcherHandler:
def __init__(self, queue):
self.queue = queue
# --- Main --- # --- Main ---
def main(): def main():
@@ -307,6 +313,9 @@ def main():
skipping = bool(skip_until) # True until we find the match skipping = bool(skip_until) # True until we find the match
skipped_count = 0 skipped_count = 0
if skip_until:
dashboard.add_log(f"Skip mode: Looking for '{skip_until}'")
def should_skip(filepath): def should_skip(filepath):
nonlocal skipping, skipped_count nonlocal skipping, skipped_count
if not skipping: if not skipping:
@@ -314,7 +323,8 @@ def main():
# Check if skip_until substring is in the filepath # Check if skip_until substring is in the filepath
if skip_until.lower() in str(filepath).lower(): if skip_until.lower() in str(filepath).lower():
skipping = False # Found it, stop skipping skipping = False # Found it, stop skipping
dashboard.add_log(f"Found '{skip_until}' - resuming from here") dashboard.add_log(f"Match found: {Path(filepath).name}")
dashboard.add_log(f"Resuming processing from here")
return False return False
skipped_count += 1 skipped_count += 1
return True return True