Skip to content

Commit ceb0af3

Browse files
committed
updates
1 parent dfeeb37 commit ceb0af3

File tree

21 files changed

+503
-86
lines changed

21 files changed

+503
-86
lines changed

frontend/static/js/settings_forms.js

Lines changed: 320 additions & 20 deletions
Large diffs are not rendered by default.

src/primary/apps/eros/missing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,13 @@ def process_missing_items(
197197

198198
# Tag the movie if enabled
199199
if tag_processed_items:
200+
from src.primary.settings_manager import get_custom_tag
201+
custom_tag = get_custom_tag("eros", "missing", "huntarr-missing")
200202
try:
201-
eros_api.tag_processed_movie(api_url, api_key, api_timeout, item_id, "huntarr-missing")
202-
eros_logger.debug(f"Tagged movie {item_id} with 'huntarr-missing'")
203+
eros_api.tag_processed_movie(api_url, api_key, api_timeout, item_id, custom_tag)
204+
eros_logger.debug(f"Tagged movie {item_id} with '{custom_tag}'")
203205
except Exception as e:
204-
eros_logger.warning(f"Failed to tag movie {item_id} with 'huntarr-missing': {e}")
206+
eros_logger.warning(f"Failed to tag movie {item_id} with '{custom_tag}': {e}")
205207

206208
# Log to history system
207209
log_processed_media("eros", item_info, item_id, instance_name, "missing")

src/primary/apps/eros/upgrade.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,13 @@ def process_cutoff_upgrades(
177177

178178
# Tag the movie if enabled
179179
if tag_processed_items:
180+
from src.primary.settings_manager import get_custom_tag
181+
custom_tag = get_custom_tag("eros", "upgrade", "huntarr-upgraded")
180182
try:
181-
eros_api.tag_processed_movie(api_url, api_key, api_timeout, item_id, "huntarr-upgraded")
182-
eros_logger.debug(f"Tagged movie {item_id} with 'huntarr-upgraded'")
183+
eros_api.tag_processed_movie(api_url, api_key, api_timeout, item_id, custom_tag)
184+
eros_logger.debug(f"Tagged movie {item_id} with '{custom_tag}'")
183185
except Exception as e:
184-
eros_logger.warning(f"Failed to tag movie {item_id} with 'huntarr-upgraded': {e}")
186+
eros_logger.warning(f"Failed to tag movie {item_id} with '{custom_tag}': {e}")
185187

186188
# Log to history so the upgrade appears in the history UI
187189
log_processed_media("eros", item_info, item_id, instance_name, "upgrade")

src/primary/apps/lidarr/missing.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,13 @@ def process_missing_albums(
244244

245245
# Tag the artist if enabled
246246
if tag_processed_items:
247+
from src.primary.settings_manager import get_custom_tag
248+
custom_tag = get_custom_tag("lidarr", "missing", "huntarr-missing")
247249
try:
248-
lidarr_api.tag_processed_artist(api_url, api_key, api_timeout, artist_id, "huntarr-missing")
249-
lidarr_logger.debug(f"Tagged artist {artist_id} with 'huntarr-missing'")
250+
lidarr_api.tag_processed_artist(api_url, api_key, api_timeout, artist_id, custom_tag)
251+
lidarr_logger.debug(f"Tagged artist {artist_id} with '{custom_tag}'")
250252
except Exception as e:
251-
lidarr_logger.warning(f"Failed to tag artist {artist_id} with 'huntarr-missing': {e}")
253+
lidarr_logger.warning(f"Failed to tag artist {artist_id} with '{custom_tag}': {e}")
252254

253255
# Also mark all albums from this artist as processed
254256
if artist_id in items_by_artist:
@@ -328,18 +330,20 @@ def process_missing_albums(
328330

329331
# Tag artists if enabled (from albums)
330332
if tag_processed_items:
333+
from src.primary.settings_manager import get_custom_tag
334+
custom_tag = get_custom_tag("lidarr", "missing", "huntarr-missing")
331335
tagged_artists = set() # Track which artists we've already tagged
332336
for album_id in album_ids_to_search:
333337
album_info = missing_items_dict.get(album_id)
334338
if album_info:
335339
artist_id = album_info.get('artistId')
336340
if artist_id and artist_id not in tagged_artists:
337341
try:
338-
lidarr_api.tag_processed_artist(api_url, api_key, api_timeout, artist_id, "huntarr-missing")
339-
lidarr_logger.debug(f"Tagged artist {artist_id} with 'huntarr-missing'")
342+
lidarr_api.tag_processed_artist(api_url, api_key, api_timeout, artist_id, custom_tag)
343+
lidarr_logger.debug(f"Tagged artist {artist_id} with '{custom_tag}'")
340344
tagged_artists.add(artist_id)
341345
except Exception as e:
342-
lidarr_logger.warning(f"Failed to tag artist {artist_id} with 'huntarr-missing': {e}")
346+
lidarr_logger.warning(f"Failed to tag artist {artist_id} with '{custom_tag}': {e}")
343347

344348
# Log to history system
345349
for album_id in album_ids_to_search:

src/primary/apps/lidarr/upgrade.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,18 @@ def process_cutoff_upgrades(
162162

163163
# Tag artists if enabled (from albums)
164164
if tag_processed_items:
165+
from src.primary.settings_manager import get_custom_tag
166+
custom_tag = get_custom_tag("lidarr", "upgrade", "huntarr-upgraded")
165167
tagged_artists = set() # Track which artists we've already tagged
166168
for album in albums_to_search:
167169
artist_id = album.get('artistId')
168170
if artist_id and artist_id not in tagged_artists:
169171
try:
170-
lidarr_api.tag_processed_artist(api_url, api_key, api_timeout, artist_id, "huntarr-upgraded")
171-
lidarr_logger.debug(f"Tagged artist {artist_id} with 'huntarr-upgraded'")
172+
lidarr_api.tag_processed_artist(api_url, api_key, api_timeout, artist_id, custom_tag)
173+
lidarr_logger.debug(f"Tagged artist {artist_id} with '{custom_tag}'")
172174
tagged_artists.add(artist_id)
173175
except Exception as e:
174-
lidarr_logger.warning(f"Failed to tag artist {artist_id} with 'huntarr-upgraded': {e}")
176+
lidarr_logger.warning(f"Failed to tag artist {artist_id} with '{custom_tag}': {e}")
175177

176178
# Log to history
177179
for album_id in album_ids_to_search:

src/primary/apps/radarr/missing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,13 @@ def process_missing_movies(
233233

234234
# Tag the movie if enabled
235235
if tag_processed_items:
236+
from src.primary.settings_manager import get_custom_tag
237+
custom_tag = get_custom_tag("radarr", "missing", "huntarr-missing")
236238
try:
237-
radarr_api.tag_processed_movie(api_url, api_key, api_timeout, movie_id, "huntarr-missing")
238-
radarr_logger.debug(f"Tagged movie {movie_id} with 'huntarr-missing'")
239+
radarr_api.tag_processed_movie(api_url, api_key, api_timeout, movie_id, custom_tag)
240+
radarr_logger.debug(f"Tagged movie {movie_id} with '{custom_tag}'")
239241
except Exception as e:
240-
radarr_logger.warning(f"Failed to tag movie {movie_id} with 'huntarr-missing': {e}")
242+
radarr_logger.warning(f"Failed to tag movie {movie_id} with '{custom_tag}': {e}")
241243

242244
# Immediately add to processed IDs to prevent duplicate processing
243245
success = add_processed_id("radarr", instance_name, str(movie_id))

src/primary/apps/radarr/upgrade.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,13 @@ def process_cutoff_upgrades(
167167

168168
# Tag the movie if enabled
169169
if tag_processed_items:
170+
from src.primary.settings_manager import get_custom_tag
171+
custom_tag = get_custom_tag("radarr", "upgrade", "huntarr-upgraded")
170172
try:
171-
radarr_api.tag_processed_movie(api_url, api_key, api_timeout, movie_id, "huntarr-upgraded")
172-
radarr_logger.debug(f"Tagged movie {movie_id} with 'huntarr-upgraded'")
173+
radarr_api.tag_processed_movie(api_url, api_key, api_timeout, movie_id, custom_tag)
174+
radarr_logger.debug(f"Tagged movie {movie_id} with '{custom_tag}'")
173175
except Exception as e:
174-
radarr_logger.warning(f"Failed to tag movie {movie_id} with 'huntarr-upgraded': {e}")
176+
radarr_logger.warning(f"Failed to tag movie {movie_id} with '{custom_tag}': {e}")
175177

176178
# Log to history so the upgrade appears in the history UI
177179
media_name = f"{movie_title} ({movie_year})"

src/primary/apps/readarr/missing.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,13 @@ def process_missing_books(
167167

168168
# Tag the book's author if enabled (keep author tagging as it's still useful)
169169
if tag_processed_items and author_id:
170+
from src.primary.settings_manager import get_custom_tag
171+
custom_tag = get_custom_tag("readarr", "missing", "huntarr-missing")
170172
try:
171-
readarr_api.tag_processed_author(api_url, api_key, api_timeout, author_id, "huntarr-missing")
172-
readarr_logger.debug(f"Tagged author {author_id} with 'huntarr-missing'")
173+
readarr_api.tag_processed_author(api_url, api_key, api_timeout, author_id, custom_tag)
174+
readarr_logger.debug(f"Tagged author {author_id} with '{custom_tag}'")
173175
except Exception as e:
174-
readarr_logger.warning(f"Failed to tag author {author_id} with 'huntarr-missing': {e}")
176+
readarr_logger.warning(f"Failed to tag author {author_id} with '{custom_tag}': {e}")
175177

176178
# Log history entry for this specific book
177179
media_name = f"{author_name} - {book_title}"

src/primary/apps/readarr/upgrade.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,18 @@ def process_cutoff_upgrades(
159159

160160
# Tag authors if enabled (from books)
161161
if tag_processed_items:
162+
from src.primary.settings_manager import get_custom_tag
163+
custom_tag = get_custom_tag("readarr", "upgrade", "huntarr-upgraded")
162164
tagged_authors = set() # Track which authors we've already tagged
163165
for book in books_to_process:
164166
author_id = book.get('authorId')
165167
if author_id and author_id not in tagged_authors:
166168
try:
167-
readarr_api.tag_processed_author(api_url, api_key, api_timeout, author_id, "huntarr-upgraded")
168-
readarr_logger.debug(f"Tagged author {author_id} with 'huntarr-upgraded'")
169+
readarr_api.tag_processed_author(api_url, api_key, api_timeout, author_id, custom_tag)
170+
readarr_logger.debug(f"Tagged author {author_id} with '{custom_tag}'")
169171
tagged_authors.add(author_id)
170172
except Exception as e:
171-
readarr_logger.warning(f"Failed to tag author {author_id} with 'huntarr-upgraded': {e}")
173+
readarr_logger.warning(f"Failed to tag author {author_id} with '{custom_tag}': {e}")
172174

173175
# Log to history system for each book
174176
for book in books_to_process:

src/primary/apps/sonarr/missing.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,15 @@ def process_missing_seasons_packs_mode(
223223
success = add_processed_id("sonarr", instance_name, season_id)
224224
sonarr_logger.debug(f"Added season ID {season_id} to processed list for {instance_name}, success: {success}")
225225

226-
# Tag the series if enabled
227-
if tag_processed_items:
228-
try:
229-
sonarr_api.tag_processed_series(api_url, api_key, api_timeout, series_id, "huntarr-missing")
230-
sonarr_logger.debug(f"Tagged series {series_id} with 'huntarr-missing'")
231-
except Exception as e:
232-
sonarr_logger.warning(f"Failed to tag series {series_id} with 'huntarr-missing': {e}")
226+
# Tag the series if enabled
227+
if tag_processed_items:
228+
from src.primary.settings_manager import get_custom_tag
229+
custom_tag = get_custom_tag("sonarr", "missing", "huntarr-missing")
230+
try:
231+
sonarr_api.tag_processed_series(api_url, api_key, api_timeout, series_id, custom_tag)
232+
sonarr_logger.debug(f"Tagged series {series_id} with '{custom_tag}'")
233+
except Exception as e:
234+
sonarr_logger.warning(f"Failed to tag series {series_id} with '{custom_tag}': {e}")
233235

234236
# Log to history system
235237
media_name = f"{series_title} - Season {season_number} (contains {episode_count} missing episodes)"
@@ -374,13 +376,15 @@ def process_missing_shows_mode(
374376
processed_any = True
375377
sonarr_logger.info(f"Successfully processed {len(episode_ids)} missing episodes in {show_title}")
376378

377-
# Tag the series if enabled
378-
if tag_processed_items:
379-
try:
380-
sonarr_api.tag_processed_series(api_url, api_key, api_timeout, show_id, "huntarr-shows-missing")
381-
sonarr_logger.debug(f"Tagged series {show_id} with 'huntarr-shows-missing'")
382-
except Exception as e:
383-
sonarr_logger.warning(f"Failed to tag series {show_id} with 'huntarr-shows-missing': {e}")
379+
# Tag the series if enabled
380+
if tag_processed_items:
381+
from src.primary.settings_manager import get_custom_tag
382+
custom_tag = get_custom_tag("sonarr", "shows_missing", "huntarr-shows-missing")
383+
try:
384+
sonarr_api.tag_processed_series(api_url, api_key, api_timeout, show_id, custom_tag)
385+
sonarr_logger.debug(f"Tagged series {show_id} with '{custom_tag}'")
386+
except Exception as e:
387+
sonarr_logger.warning(f"Failed to tag series {show_id} with '{custom_tag}': {e}")
384388

385389
# Add episode IDs to stateful manager IMMEDIATELY after processing each batch
386390
for episode_id in episode_ids:

0 commit comments

Comments
 (0)