fix: webhook episode processing now uses real Sonarr import history
Critical Fix for Episode Import Dates: - Webhook episodes now query Sonarr import history instead of using current time - Fix _get_webhook_episode_date() to follow same logic as manual scans - Convert import dates from UTC to local timezone for NFO dateadded fields - Episodes now show 'sonarr:history.import' source instead of 'webhook:new_download' Before: <dateadded>2025-09-14T12:40:07+00:00</dateadded> (current webhook time) After: <dateadded>2025-09-14T08:40:07-04:00</dateadded> (real import time in local timezone) This fixes the issue where episodes downloaded at 8:40am EST were showing 12:40pm UTC webhook time instead of the actual import timestamp. Enhanced webhook processing now: 1. Checks database for existing entries (prevents duplicates) 2. Queries Sonarr import history for real import dates 3. Converts UTC import dates to local timezone 4. Only uses current time as last resort for true new downloads
This commit is contained in: