mirror of
https://github.com/plexguide/Huntarr.io.git
synced 2026-02-12 09:10:35 -06:00
Refactor logging in API connection methods across Eros, Lidarr, Radarr, Readarr, Sonarr, and Whisparr to use debug level for auto-correcting URLs, enhancing log clarity and reducing warning noise.
This commit is contained in:
@@ -44,9 +44,9 @@ def get_configured_instances():
|
||||
|
||||
# Enhanced URL validation - ensure URL has proper scheme
|
||||
if api_url and not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
eros_logger.warning(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
eros_logger.debug(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
eros_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
eros_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
is_enabled = instance.get("enabled", True)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ def test_connection(url, api_key):
|
||||
if not (url.startswith('http://') or url.startswith('https://')):
|
||||
eros_logger.warning(f"API URL missing http(s) scheme: {url}")
|
||||
url = f"http://{url}"
|
||||
eros_logger.warning(f"Auto-correcting URL to: {url}")
|
||||
eros_logger.debug(f"Auto-correcting URL to: {url}")
|
||||
|
||||
# Try to establish a socket connection first to check basic connectivity
|
||||
parsed_url = urlparse(url)
|
||||
@@ -179,7 +179,7 @@ def test_connection_endpoint():
|
||||
if not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
eros_logger.warning(f"API URL missing http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
eros_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
eros_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
return test_connection(api_url, api_key)
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ def get_configured_instances():
|
||||
|
||||
# Enhanced URL validation - ensure URL has proper scheme
|
||||
if api_url and not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
lidarr_logger.warning(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
lidarr_logger.debug(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
lidarr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
lidarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
is_enabled = instance.get("enabled", True)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ def test_connection():
|
||||
if not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
lidarr_logger.warning(f"API URL missing http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
lidarr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
lidarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
# Try to establish a socket connection first to check basic connectivity
|
||||
parsed_url = urlparse(api_url)
|
||||
|
||||
@@ -32,9 +32,9 @@ def get_configured_instances():
|
||||
|
||||
# Enhanced URL validation - ensure URL has proper scheme
|
||||
if api_url and not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
radarr_logger.warning(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
radarr_logger.debug(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
radarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
radarr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
# Create a settings object for this instance by combining global settings with instance-specific ones
|
||||
instance_settings = settings.copy()
|
||||
|
||||
@@ -207,7 +207,7 @@ def process_missing_movies(
|
||||
else:
|
||||
# No valid release dates found at all, include in search to be safe
|
||||
should_include = True
|
||||
radarr_logger.warning(f"Movie ID {movie.get('id')} ('{movie.get('title')}') has no physicalRelease, digitalRelease, inCinemas, or releaseDate fields - including in search but this may indicate missing metadata in Radarr")
|
||||
radarr_logger.debug(f"Movie ID {movie.get('id')} ('{movie.get('title')}') has no physicalRelease, digitalRelease, inCinemas, or releaseDate fields - including in search but this may indicate missing metadata in Radarr")
|
||||
|
||||
if should_include:
|
||||
filtered_movies.append(movie)
|
||||
|
||||
@@ -34,7 +34,7 @@ def test_connection():
|
||||
if not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
radarr_logger.warning(f"API URL missing http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
radarr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
radarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
# Try to establish a socket connection first to check basic connectivity
|
||||
parsed_url = urlparse(api_url)
|
||||
|
||||
@@ -33,9 +33,9 @@ def get_configured_instances():
|
||||
|
||||
# Enhanced URL validation - ensure URL has proper scheme
|
||||
if api_url and not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
readarr_logger.warning(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
readarr_logger.debug(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
readarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
readarr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
is_enabled = instance.get("enabled", True)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def test_connection():
|
||||
if not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
readarr_logger.warning(f"API URL missing http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
readarr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
readarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
# For Readarr, use api/v1
|
||||
url = f"{api_url}/api/v1/system/status"
|
||||
|
||||
@@ -32,9 +32,9 @@ def get_configured_instances():
|
||||
|
||||
# Enhanced URL validation - ensure URL has proper scheme
|
||||
if api_url and not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
sonarr_logger.warning(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
sonarr_logger.debug(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
sonarr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
sonarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
is_enabled = instance.get("enabled", True)
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ def test_connection():
|
||||
|
||||
# Auto-correct URL if missing http(s) scheme
|
||||
if not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
sonarr_logger.warning(f"API URL missing http(s) scheme: {api_url}")
|
||||
sonarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
sonarr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
sonarr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
# Try to establish a socket connection first to check basic connectivity
|
||||
parsed_url = urlparse(api_url)
|
||||
|
||||
@@ -44,9 +44,9 @@ def get_configured_instances():
|
||||
|
||||
# Enhanced URL validation - ensure URL has proper scheme
|
||||
if api_url and not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
whisparr_logger.warning(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
whisparr_logger.debug(f"Instance '{instance.get('name', 'Unnamed')}' has URL without http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
whisparr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
whisparr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
is_enabled = instance.get("enabled", True)
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ def test_connection():
|
||||
if not (api_url.startswith('http://') or api_url.startswith('https://')):
|
||||
whisparr_logger.warning(f"API URL missing http(s) scheme: {api_url}")
|
||||
api_url = f"http://{api_url}"
|
||||
whisparr_logger.warning(f"Auto-correcting URL to: {api_url}")
|
||||
whisparr_logger.debug(f"Auto-correcting URL to: {api_url}")
|
||||
|
||||
# Try to establish a socket connection first to check basic connectivity
|
||||
parsed_url = urlparse(api_url)
|
||||
|
||||
Reference in New Issue
Block a user