22 lines
633 B
Python
22 lines
633 B
Python
"""
|
|
Scanner service for initial library scan
|
|
"""
|
|
import logging
|
|
from app.tasks.scan import scan_all_source_roots, watch_folders
|
|
from app.config import settings
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
async def start_initial_scan():
|
|
"""Start the initial library scan"""
|
|
try:
|
|
# Queue scan of all source roots
|
|
scan_all_source_roots.delay()
|
|
|
|
# Start folder watcher if configured
|
|
if settings.scanner.watch:
|
|
watch_folders.delay()
|
|
|
|
logger.info("Initial scan queued successfully")
|
|
except Exception as e:
|
|
logger.error(f"Failed to start initial scan: {e}") |