"""
file_watcher.py — Minimal fil-watcher.
Scanning håndteres af scanner.py / ScanWorker.
"""
# Fil-watcher er deaktiveret — scanning sker via ScanWorker i library_manager
# Denne fil beholdes til fremtidig live-overvågning

class LibraryWatcher:
    def __init__(self, on_change=None):
        self.on_change = on_change
        self._running  = False

    def start(self):
        self._running = True

    def stop(self):
        self._running = False

    def add_library(self, path: str) -> int:
        from local.local_db import add_library
        return add_library(path)

    def remove_library(self, library_id: int):
        from local.local_db import remove_library
        remove_library(library_id)


_watcher_instance = None

def get_watcher(on_change=None) -> LibraryWatcher:
    global _watcher_instance
    if _watcher_instance is None:
        _watcher_instance = LibraryWatcher(on_change=on_change)
    return _watcher_instance
