feat: complete timezone support for NFO dateadded fields

- Fix NFO dateadded timestamps to use local timezone instead of UTC
- Convert Radarr/Sonarr import dates from UTC to local timezone for NFO files
- Update webhook episode processing to use local time for new downloads
- Convert file modification time fallbacks to local timezone
- Preserve historical dates (aired, premiered) in original UTC format
- Replace all placeholder logging functions with centralized timezone-aware logging
- Add convert_utc_to_local() utility function for timestamp conversion
- Now all logs AND NFO files show consistent local timezone formatting

Users with TZ=America/New_York will now see:
- Logs: [2025-09-14T09:37:00-04:00]
- NFO files: <dateadded>2025-09-14T09:37:00-04:00</dateadded>
This commit is contained in:
2025-09-14 09:56:27 -04:00
parent 5c7300fc74
commit 7af7b1c43e
7 changed files with 113 additions and 31 deletions
+1 -4
View File
@@ -9,10 +9,7 @@ from datetime import datetime, timezone
from typing import Optional, Dict, Any
import xml.etree.ElementTree as ET
def _log(level: str, msg: str):
"""Placeholder logging function - replace with your actual logger"""
print(f"[{datetime.now().isoformat()}] {level}: {msg}")
from core.logging import _log
class NFOManager: