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,15 +259,21 @@ def worker_wrapper(worker_id, file_path, category, lock_dir, log_dir, encoders,
dashboard.update_worker(worker_id, "Idle", "Waiting", "dim")
# --- Monitor ---
class WatcherHandler(FileSystemEventHandler):
def __init__(self, queue):
self.queue = queue
def on_created(self, event):
if not event.is_directory and event.src_path.lower().endswith(('.mkv', '.mp4')):
self.queue.put(Path(event.src_path))
def on_moved(self, event):
if not event.is_directory and event.dest_path.lower().endswith(('.mkv', '.mp4')):
self.queue.put(Path(event.dest_path))
if HAS_WATCHDOG:
class WatcherHandler(FileSystemEventHandler):
def __init__(self, queue):
self.queue = queue
def on_created(self, event):
if not event.is_directory and event.src_path.lower().endswith(('.mkv', '.mp4')):
self.queue.put(Path(event.src_path))
def on_moved(self, event):
if not event.is_directory and event.dest_path.lower().endswith(('.mkv', '.mp4')):
self.queue.put(Path(event.dest_path))
else:
# Dummy class when watchdog not available
class WatcherHandler:
def __init__(self, queue):
self.queue = queue
# --- Main ---
def main():
@@ -307,6 +313,9 @@ def main():
skipping = bool(skip_until) # True until we find the match
skipped_count = 0
if skip_until:
dashboard.add_log(f"Skip mode: Looking for '{skip_until}'")
def should_skip(filepath):
nonlocal skipping, skipped_count
if not skipping:
@@ -314,7 +323,8 @@ def main():
# Check if skip_until substring is in the filepath
if skip_until.lower() in str(filepath).lower():
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
skipped_count += 1
return True