Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ RUN mkdir -p /config && chmod -R 755 /config
# Set environment variables
ENV PYTHONPATH=/app
ENV TZ=UTC
ENV LOG_LEVEL=INFO
# ENV APP_TYPE=sonarr # APP_TYPE is likely managed via config now, remove if not needed

# Expose port
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
environment:
- TZ=${TZ:-UTC}
- BASE_URL=${BASE_URL:-}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
restart: unless-stopped
# Graceful shutdown configuration
stop_signal: SIGTERM
Expand Down
23 changes: 23 additions & 0 deletions docs/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ <h2><i class="fas fa-rocket" style="margin-right: 10px; color: #3498db;"></i>Ins
-p 9705:9705 \
-v /path/to/huntarr/config:/config \
-e TZ=America/New_York \
-e LOG_LEVEL=INFO \
huntarr/huntarr:latest</code></pre>

<div class="alert alert-warning">
Expand Down Expand Up @@ -325,13 +326,35 @@ <h2><i class="fab fa-docker" style="margin-right: 10px; color: #2496ed;"></i>Doc
- ./huntarr-config:/config
environment:
- TZ=America/New_York
- LOG_LEVEL=INFO
- PUID=1000
- PGID=1000</code></pre>

<strong>Run with:</strong>
<pre class="terminal"><code>docker-compose up -d</code></pre>
</div>
</div>

<div class="faq-item">
<div class="faq-question">How do I enable debug logging for troubleshooting?</div>
<div class="faq-answer">
Set the LOG_LEVEL environment variable to DEBUG:

<pre class="terminal"><code># For Docker run:
docker run ... -e LOG_LEVEL=DEBUG huntarr/huntarr:latest

# For docker-compose, add to environment section:
environment:
- LOG_LEVEL=DEBUG

# Then restart the container:
docker restart huntarr</code></pre>

<div class="alert alert-info">
<strong>Remember:</strong> Set LOG_LEVEL back to INFO after troubleshooting to reduce log verbosity.
</div>
</div>
</div>
</section>

<section id="connection-problems" class="installation-methods">
Expand Down
10 changes: 8 additions & 2 deletions docs/getting-started/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ <h5><i class="fab fa-docker" style="margin-right: 8px; color: #2496ed;"></i>Opti
-p 9705:9705 \
-v /your-path/huntarr:/config \
-e TZ=America/New_York \
-e LOG_LEVEL=INFO \
huntarr/huntarr:latest</code></pre>

<h5><i class="fab fa-github" style="margin-right: 8px; color: #333;"></i>Option 2: GitHub Container Registry</h5>
Expand All @@ -100,6 +101,7 @@ <h5><i class="fab fa-github" style="margin-right: 8px; color: #333;"></i>Option
-p 9705:9705 \
-v /your-path/huntarr:/config \
-e TZ=America/New_York \
-e LOG_LEVEL=INFO \
ghcr.io/plexguide/huntarr:latest</code></pre>

<p>To check on the status of the program:</p>
Expand All @@ -119,7 +121,8 @@ <h5><i class="fab fa-docker" style="margin-right: 8px; color: #2496ed;"></i>Opti
volumes:
- /your-path/huntarr:/config
environment:
- TZ=America/New_York</code></pre>
- TZ=America/New_York
- LOG_LEVEL=INFO</code></pre>

<h5><i class="fab fa-github" style="margin-right: 8px; color: #333;"></i>Option 2: GitHub Container Registry</h5>
<pre class="terminal"><code>services:
Expand All @@ -132,7 +135,8 @@ <h5><i class="fab fa-github" style="margin-right: 8px; color: #333;"></i>Option
volumes:
- /your-path/huntarr:/config
environment:
- TZ=America/New_York</code></pre>
- TZ=America/New_York
- LOG_LEVEL=INFO</code></pre>

<p>Then run:</p>
<pre class="terminal"><code class="command-prompt">docker-compose up -d huntarr</code></pre>
Expand Down Expand Up @@ -182,6 +186,7 @@ <h5><i class="fab fa-docker" style="margin-right: 8px; color: #2496ed;"></i>Dock
-p 9705:9705 \
-v /mnt/user/appdata/huntarr:/config \
-e TZ=America/New_York \
-e LOG_LEVEL=INFO \
huntarr/huntarr:latest</code></pre>

<h5><i class="fab fa-github" style="margin-right: 8px; color: #333;"></i>GitHub Container Registry</h5>
Expand All @@ -190,6 +195,7 @@ <h5><i class="fab fa-github" style="margin-right: 8px; color: #333;"></i>GitHub
-p 9705:9705 \
-v /mnt/user/appdata/huntarr:/config \
-e TZ=America/New_York \
-e LOG_LEVEL=INFO \
ghcr.io/plexguide/huntarr:latest</code></pre>
</div>

Expand Down
22 changes: 22 additions & 0 deletions docs/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ <h3>Table of Contents</h3>
<li><a href="#debug-mode">Debug Mode</a></li>
<li><a href="#display-resources">Display Resources</a></li>
<li><a href="#low-usage-mode">Low Usage Mode</a></li>
<li><a href="#log-level">Log Level Configuration</a></li>
</ul>
</li>
<li><a href="#notifications">Notifications</a>
Expand Down Expand Up @@ -172,6 +173,27 @@ <h3 id="low-usage-mode"><a href="#low-usage-mode" class="info-icon"><i class="fa
</ul>

<p>The setting takes effect immediately and doesn't require a restart. You can toggle it on and off as needed depending on your current usage requirements.</p>

<h3 id="log-level"><a href="#log-level" class="info-icon"><i class="fas fa-info-circle"></i></a> Log Level Configuration</h3>
<p>Controls the verbosity of Huntarr's logging output through the LOG_LEVEL environment variable.</p>

<p>Available log levels:</p>
<ul>
<li><strong>DEBUG:</strong> Detailed information for troubleshooting issues</li>
<li><strong>INFO:</strong> General information about operations (default)</li>
<li><strong>WARNING:</strong> Important warnings that don't stop operation</li>
<li><strong>ERROR:</strong> Error messages for serious issues</li>
<li><strong>CRITICAL:</strong> Critical errors that may stop operation</li>
</ul>

<p>Set this in your Docker environment:</p>
<pre><code>-e LOG_LEVEL=DEBUG</code></pre>

<p>Or in docker-compose.yml:</p>
<pre><code>environment:
- LOG_LEVEL=DEBUG</code></pre>

<p>Changes require a container restart to take effect. Use DEBUG level for troubleshooting, then return to INFO for normal operation to reduce log verbosity.</p>
</section>

<section id="notifications">
Expand Down
6 changes: 3 additions & 3 deletions src/primary/apps/lidarr/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def process_missing_albums(
# Make sure any requested stop function is executable
stop_check = stop_check if callable(stop_check) else lambda: False

lidarr_logger.info(f"Looking for missing albums for {instance_name}")
lidarr_logger.debug(f"Looking for missing albums for {instance_name}")
lidarr_logger.debug(f"Processing up to {hunt_missing_items} missing items in {hunt_missing_mode} mode")

# Reset state files if enough time has passed
Expand All @@ -80,7 +80,7 @@ def process_missing_albums(
try:
# Get missing albums or artists data based on the hunt_missing_mode
if hunt_missing_mode == "album":
lidarr_logger.info("Retrieving missing albums for album-based processing...")
lidarr_logger.debug("Retrieving missing albums for album-based processing...")
# Use efficient random page selection instead of fetching all albums
missing_albums_data = lidarr_api.get_missing_albums_random_page(
api_url, api_key, api_timeout, monitored_only, total_items_to_process * 2
Expand All @@ -94,7 +94,7 @@ def process_missing_albums(
lidarr_logger.info("No missing albums found.")
return False

lidarr_logger.info(f"Retrieved {len(missing_albums_data)} missing albums from random page selection.")
lidarr_logger.debug(f"Retrieved {len(missing_albums_data)} missing albums from random page selection.")

# Convert to the expected format for album processing - keep IDs as integers
unprocessed_entities = []
Expand Down
24 changes: 12 additions & 12 deletions src/primary/apps/radarr/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def process_missing_movies(
tag_processed_items = radarr_settings.get("tag_processed_items", True)

# Log important settings
radarr_logger.info("=== Radarr Missing Movies Settings ===")
radarr_logger.debug("=== Radarr Missing Movies Settings ===")
radarr_logger.debug(f"Instance Name: {instance_name}")

# Extract necessary settings
Expand Down Expand Up @@ -101,7 +101,7 @@ def process_missing_movies(
return False

# Get missing movies
radarr_logger.info("Retrieving movies with missing files...")
radarr_logger.debug("Retrieving movies with missing files...")
# Use efficient random page selection instead of fetching all movies
missing_movies = radarr_api.get_movies_with_missing_random_page(
api_url, api_key, api_timeout, monitored_only, hunt_missing_movies * 2
Expand All @@ -115,11 +115,11 @@ def process_missing_movies(
radarr_logger.info("No missing movies found.")
return False

radarr_logger.info(f"Retrieved {len(missing_movies)} missing movies from random page selection.")
radarr_logger.debug(f"Retrieved {len(missing_movies)} missing movies from random page selection.")

# Skip future releases if enabled
if skip_future_releases:
radarr_logger.info("Filtering out future releases...")
radarr_logger.debug("Filtering out future releases...")
now = datetime.datetime.now(datetime.timezone.utc)

filtered_movies = []
Expand Down Expand Up @@ -160,14 +160,14 @@ def process_missing_movies(
radarr_logger.debug(f"Skipping movie ID {movie_id} ('{movie_title}') - no releaseDate field and process_no_release_dates is disabled")
no_date_count += 1

radarr_logger.info(f"Filtered out {skipped_count} future releases and {no_date_count} movies with no release dates")
radarr_logger.debug(f"Filtered out {skipped_count} future releases and {no_date_count} movies with no release dates")
radarr_logger.debug(f"After filtering: {len(filtered_movies)} movies remaining from {len(missing_movies)} original")
missing_movies = filtered_movies
else:
radarr_logger.info("Skip future releases is disabled - processing all movies regardless of release date")
radarr_logger.debug("Skip future releases is disabled - processing all movies regardless of release date")

if not missing_movies:
radarr_logger.info("No missing movies left to process after filtering future releases.")
radarr_logger.debug("No missing movies left to process after filtering future releases.")
return False

movies_processed = 0
Expand All @@ -182,20 +182,20 @@ def process_missing_movies(
else:
radarr_logger.debug(f"Skipping already processed movie ID: {movie_id}")

radarr_logger.info(f"Found {len(unprocessed_movies)} unprocessed missing movies out of {len(missing_movies)} total.")
radarr_logger.debug(f"Found {len(unprocessed_movies)} unprocessed missing movies out of {len(missing_movies)} total.")

if not unprocessed_movies:
radarr_logger.info("No unprocessed missing movies found. All available movies have been processed.")
radarr_logger.debug("No unprocessed missing movies found. All available movies have been processed.")
return False

# Always use random selection for missing movies
radarr_logger.info(f"Using random selection for missing movies")
radarr_logger.debug(f"Using random selection for missing movies")
if len(unprocessed_movies) > hunt_missing_movies:
movies_to_process = random.sample(unprocessed_movies, hunt_missing_movies)
else:
movies_to_process = unprocessed_movies

radarr_logger.info(f"Selected {len(movies_to_process)} movies to process.")
radarr_logger.debug(f"Selected {len(movies_to_process)} movies to process.")

# Add detailed logging for selected movies
if movies_to_process:
Expand Down Expand Up @@ -260,4 +260,4 @@ def process_missing_movies(
radarr_logger.warning(f"Failed to trigger search for movie '{movie_title}'")

radarr_logger.info(f"Finished processing missing movies. Processed {movies_processed} of {len(movies_to_process)} selected movies.")
return processed_any
return processed_any
8 changes: 4 additions & 4 deletions src/primary/apps/readarr/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def process_missing_books(
Returns:
True if any books were processed, False otherwise.
"""
readarr_logger.info("Starting missing books processing cycle for Readarr.")
readarr_logger.debug("Starting missing books processing cycle for Readarr.")
processed_any = False

# Reset state files if enough time has passed
Expand All @@ -51,7 +51,7 @@ def process_missing_books(
api_timeout = get_advanced_setting("api_timeout", 120) # Use database value
instance_name = app_settings.get("instance_name", "Readarr Default")

readarr_logger.info(f"Using API timeout of {api_timeout} seconds for Readarr")
readarr_logger.debug(f"Using API timeout of {api_timeout} seconds for Readarr")

monitored_only = app_settings.get("monitored_only", True)
skip_future_releases = app_settings.get("skip_future_releases", True)
Expand All @@ -78,7 +78,7 @@ def process_missing_books(
return False

# Get missing books
readarr_logger.info(f"Retrieving books with missing files...")
readarr_logger.debug(f"Retrieving books with missing files...")
# Use efficient random page selection instead of fetching all books
missing_books_data = readarr_api.get_wanted_missing_books_random_page(
api_url, api_key, api_timeout, monitored_only, hunt_missing_books * 2
Expand All @@ -91,7 +91,7 @@ def process_missing_books(
readarr_logger.info("No missing books found.")
return False

readarr_logger.info(f"Retrieved {len(missing_books_data)} missing books from random page selection.")
readarr_logger.debug(f"Retrieved {len(missing_books_data)} missing books from random page selection.")

# Check for stop signal after retrieving books
if stop_check():
Expand Down
Loading