fix(scheduler): skip rescan during initial setup when anime directory not configured
Prevent scheduler from triggering immediate rescan when: - No previous scan recorded AND initial setup not yet completed - Anime directory doesn't exist during initial sync The setup flow will trigger rescan when ready. Also adds graceful handling when anime directory is missing during data file sync. Fixes: 503 error on setup when scheduler triggers rescan before anime directory is configured
This commit is contained in:
@@ -215,6 +215,20 @@ async def _sync_anime_folders(progress_service=None) -> int:
|
||||
"""
|
||||
logger.info("Performing initial anime folder scan...")
|
||||
|
||||
# Check if anime directory exists before attempting sync
|
||||
if not settings.anime_directory or not os.path.isdir(settings.anime_directory):
|
||||
logger.info(
|
||||
"Anime directory not configured or does not exist, skipping data file sync"
|
||||
)
|
||||
if progress_service:
|
||||
await progress_service.update_progress(
|
||||
progress_id="series_sync",
|
||||
current=100,
|
||||
message="No anime directory configured, skipping data file sync",
|
||||
metadata={"step_id": "series_sync"}
|
||||
)
|
||||
return 0
|
||||
|
||||
if progress_service:
|
||||
await progress_service.update_progress(
|
||||
progress_id="series_sync",
|
||||
|
||||
Reference in New Issue
Block a user