radarr updates
This commit is contained in:
+45
-10
@@ -94,9 +94,9 @@ def _setup_file_logging():
|
||||
_file_logger = logging.getLogger("NFOGuard")
|
||||
_file_logger.setLevel(logging.DEBUG)
|
||||
|
||||
# Rotating file handler (10MB max, 5 backups)
|
||||
# Rotating file handler (50MB max, 3 backups - reduced rotation frequency)
|
||||
file_handler = logging.handlers.RotatingFileHandler(
|
||||
log_file, maxBytes=10*1024*1024, backupCount=5
|
||||
log_file, maxBytes=50*1024*1024, backupCount=3
|
||||
)
|
||||
|
||||
# Detailed format for file logging
|
||||
@@ -1729,19 +1729,49 @@ async def debug_movie_import_date(imdb_id: str):
|
||||
"quality": f.get("quality", {}).get("quality", {}).get("name", "Unknown")
|
||||
})
|
||||
|
||||
# Get raw history for analysis
|
||||
# Get ALL history pages - July events might be in older pages
|
||||
raw_history = []
|
||||
try:
|
||||
data = rc._get("/api/v3/history", {
|
||||
"movieId": movie_id, "sortKey": "date", "sortDirection": "ascending", "pageSize": 50
|
||||
})
|
||||
records = data if isinstance(data, list) else data.get("records", [])
|
||||
page = 1
|
||||
all_records = []
|
||||
|
||||
for record in records:
|
||||
# Fetch multiple pages to find older events
|
||||
while page <= 10: # Get up to 10 pages (500 records)
|
||||
data = rc._get("/api/v3/history", {
|
||||
"movieId": movie_id, "sortKey": "date", "sortDirection": "ascending",
|
||||
"pageSize": 50, "page": page
|
||||
})
|
||||
|
||||
if not data:
|
||||
break
|
||||
|
||||
records = data if isinstance(data, list) else data.get("records", [])
|
||||
if not records:
|
||||
break
|
||||
|
||||
all_records.extend(records)
|
||||
|
||||
# If we got less than 50, we've reached the end
|
||||
if len(records) < 50:
|
||||
break
|
||||
|
||||
page += 1
|
||||
|
||||
_log("INFO", f"Fetched {len(all_records)} total history records across {page-1} pages for debug")
|
||||
|
||||
for record in all_records:
|
||||
event_type = record.get("eventType", "")
|
||||
date_str = record.get("date", "")
|
||||
event_data = record.get("data", {})
|
||||
source_path = event_data.get('sourcePath', '') or event_data.get('path', '') or event_data.get('sourceTitle', '')
|
||||
|
||||
# Try multiple ways to get source path info
|
||||
source_path = (
|
||||
event_data.get('sourcePath', '') or
|
||||
event_data.get('path', '') or
|
||||
event_data.get('sourceTitle', '') or
|
||||
record.get('sourcePath', '') or
|
||||
record.get('sourceTitle', '')
|
||||
)
|
||||
|
||||
# Check if this looks like a real import
|
||||
is_import_type = any(word in event_type.lower() for word in ['import', 'download'])
|
||||
@@ -1750,13 +1780,18 @@ async def debug_movie_import_date(imdb_id: str):
|
||||
'nzbget', 'sabnzbd', 'radarr', 'completed'
|
||||
])
|
||||
|
||||
# Check for July 7 events specifically
|
||||
is_july_7 = "2025-07-07" in date_str or "2025-07-08" in date_str # Include July 8 for timezone differences
|
||||
|
||||
raw_history.append({
|
||||
"eventType": event_type,
|
||||
"date": date_str,
|
||||
"sourcePath": source_path,
|
||||
"fullData": event_data, # Include full data for analysis
|
||||
"isImportType": is_import_type,
|
||||
"isFromDownloads": is_from_downloads,
|
||||
"isRealImport": is_import_type and is_from_downloads
|
||||
"isRealImport": is_import_type and is_from_downloads,
|
||||
"isJuly7Event": is_july_7
|
||||
})
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user