feat: structure
This commit is contained in:
22
backend/app/services/scanner.py
Normal file
22
backend/app/services/scanner.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
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}")
|
||||
Reference in New Issue
Block a user