chore: apply pending code updates

This commit is contained in:
2026-03-17 11:39:27 +01:00
parent e5fae0a0a2
commit 92bd55ada1
45 changed files with 2236 additions and 2130 deletions

View File

@@ -724,9 +724,9 @@ async def add_series(
if series_app and hasattr(series_app, 'loader'):
try:
year = series_app.loader.get_year(key)
logger.info(f"Fetched year for {key}: {year}")
logger.info("Fetched year for %s: %s", key, year)
except Exception as e:
logger.warning(f"Could not fetch year for {key}: {e}")
logger.warning("Could not fetch year for %s: %s", key, e)
# Create folder name with year if available
if year:

View File

@@ -91,7 +91,7 @@ async def check_database_health(db: AsyncSession) -> DatabaseHealth:
message="Database connection successful",
)
except Exception as e:
logger.error(f"Database health check failed: {e}")
logger.error("Database health check failed: %s", e)
return DatabaseHealth(
status="unhealthy",
connection_time_ms=0,
@@ -121,7 +121,7 @@ async def check_filesystem_health() -> Dict[str, Any]:
"message": "Filesystem check completed",
}
except Exception as e:
logger.error(f"Filesystem health check failed: {e}")
logger.error("Filesystem health check failed: %s", e)
return {
"status": "unhealthy",
"message": f"Filesystem check failed: {str(e)}",
@@ -164,7 +164,7 @@ def get_system_metrics() -> SystemMetrics:
uptime_seconds=uptime_seconds,
)
except Exception as e:
logger.error(f"System metrics collection failed: {e}")
logger.error("System metrics collection failed: %s", e)
raise HTTPException(
status_code=500, detail=f"Failed to collect system metrics: {str(e)}"
)
@@ -236,7 +236,7 @@ async def detailed_health_check(
startup_time=startup_time,
)
except Exception as e:
logger.error(f"Detailed health check failed: {e}")
logger.error("Detailed health check failed: %s", e)
raise HTTPException(status_code=500, detail="Health check failed")

View File

@@ -243,7 +243,7 @@ async def get_missing_nfo(
)
except Exception as e:
logger.error(f"Error getting missing NFOs: {e}", exc_info=True)
logger.exception("Error getting missing NFOs: %s", e)
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=f"Failed to get missing NFOs: {str(e)}"
@@ -334,7 +334,7 @@ async def check_nfo(
except HTTPException:
raise
except Exception as e:
logger.error(f"Error checking NFO for {serie_id}: {e}", exc_info=True)
logger.exception("Error checking NFO for %s: %s", serie_id, e)
raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=f"Failed to check NFO: {str(e)}"
@@ -429,7 +429,7 @@ async def create_nfo(
except HTTPException:
raise
except TMDBAPIError as e:
logger.warning(f"TMDB API error creating NFO for {serie_id}: {e}")
logger.warning("TMDB API error creating NFO for %s: %s", serie_id, e)
raise HTTPException(
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
detail=f"TMDB API error: {str(e)}"
@@ -524,7 +524,7 @@ async def update_nfo(
except HTTPException:
raise
except TMDBAPIError as e:
logger.warning(f"TMDB API error updating NFO for {serie_id}: {e}")
logger.warning("TMDB API error updating NFO for %s: %s", serie_id, e)
raise HTTPException(
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
detail=f"TMDB API error: {str(e)}"