update to db call

This commit is contained in:
2025-09-08 18:00:50 -04:00
parent 935307a74d
commit 19b40c0fd5
3 changed files with 23 additions and 18 deletions
+13
View File
@@ -6,6 +6,19 @@ All notable changes to this project will be documented in this file.
# Changelog # Changelog
## [0.5.1] - 2025-09-08
### Changed
- **BREAKING**: RadarrClient now operates in DATABASE ONLY mode
- Completely eliminated Radarr API usage for movie lookups and import date detection
- All movie operations now use direct database queries exclusively
- Debug endpoints updated to use database-only methods
- Enhanced error messaging when database access is not configured
### Fixed
- Fixed debug endpoint still calling API methods despite database availability
- Removed all API fallback mechanisms for true database-only operation
## [0.5.0] - 2025-09-08 ## [0.5.0] - 2025-09-08
### Added ### Added
+1 -1
View File
@@ -1 +1 @@
0.5.0 0.5.1
+9 -17
View File
@@ -864,24 +864,16 @@ async def debug_movie_import_date(imdb_id: str):
_log("INFO", f"Found movie: {movie_title} (Radarr ID: {movie_id})") _log("INFO", f"Found movie: {movie_title} (Radarr ID: {movie_id})")
# Get import date with detailed logging - use the optimized method # Get import date with detailed logging - DATABASE ONLY
import_date = radarr_client.earliest_import_event_optimized(movie_id) import_date, source = radarr_client.get_movie_import_date(movie_id, fallback_to_file_date=True)
if import_date:
source = "radarr:history.import.optimized"
else:
# Fallback to file dateAdded
import_date = radarr_client.earliest_file_dateadded(movie_id)
source = "radarr:file.dateAdded" if import_date else "no_date_found"
# Get movie files # Movie files info - DATABASE ONLY mode (minimal info)
movie_files = radarr_client.movie_files(movie_id)
file_info = [] file_info = []
for f in movie_files: if import_date:
file_info.append({ file_info.append({
"id": f.get("id"), "note": "DATABASE ONLY MODE - File details from database queries",
"relativePath": f.get("relativePath"), "import_date_used": import_date,
"dateAdded": f.get("dateAdded"), "source": source
"quality": f.get("quality", {}).get("quality", {}).get("name", "Unknown")
}) })
return { return {
@@ -991,8 +983,8 @@ async def debug_movie_history(imdb_id: str):
"full_data": event_data "full_data": event_data
}) })
# Find what our algorithm would pick # Find what our algorithm would pick - DATABASE ONLY
picked_date = radarr_client.earliest_import_event_optimized(movie_id) picked_date, _ = radarr_client.get_movie_import_date(movie_id, fallback_to_file_date=True)
return { return {
"imdb_id": imdb_id, "imdb_id": imdb_id,