fix: Only fallback to airdate when Sonarr has no import date
Local Docker Build (Dev) / build-dev (pull_request) Successful in 23s

- Modified fallback logic to only use airdate as dateadded when source is NOT 'sonarr:history.import'
- This prevents using airdate fallback when Sonarr has valid import dates available
- Ensures Sonarr import dates are prioritized over airdate fallbacks
- Addresses issue where episodes with valid Sonarr import dates were still falling back to airdates
This commit is contained in:
2025-10-05 10:42:35 -04:00
parent 191e6f5f3f
commit 5ade28c118
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -131,8 +131,9 @@ class TVProcessor:
if not dateadded:
source = "external"
# Use air date as fallback for dateadded if available
if not dateadded and aired:
# ONLY use air date as fallback for dateadded if we have no Sonarr import date at all
# and if we couldn't get any import information from Sonarr history
if not dateadded and aired and source != "sonarr:history.import":
dateadded = aired
source = f"{source}_fallback" if source != "unknown" else "aired_fallback"