digital release date

This commit is contained in:
2025-09-09 09:18:33 -04:00
parent 149bf9acd3
commit bbbf4b63cc
3 changed files with 171 additions and 21 deletions
+82 -10
View File
@@ -73,25 +73,97 @@ BATCH_DELAY 5.0 Delay before processing batched events
DEBUG false Enable verbose logging
🔌 API Endpoints
POST /webhook/sonarr Sonarr events
POST /webhook/radarr Radarr events
### Webhook Endpoints
```bash
# Radarr webhook (automatic processing)
POST /webhook/radarr
POST /manual/scan?scan_type=both Manual scan (TV + Movies) [DEFAULT]
# Sonarr webhook (automatic processing)
POST /webhook/sonarr
```
POST /manual/scan?scan_type=tv Manual scan TV only
### Manual Processing
```bash
# Manual scan all media
curl -X POST "http://localhost:8080/manual/scan?scan_type=both"
POST /manual/scan?scan_type=movies Manual scan Movies only
# Manual scan TV only
curl -X POST "http://localhost:8080/manual/scan?scan_type=tv"
POST /manual/scan?path=/media/movies Manual scan specific path
# Manual scan movies only
curl -X POST "http://localhost:8080/manual/scan?scan_type=movies"
GET /health Health check
# Manual scan specific path
curl -X POST "http://localhost:8080/manual/scan?path=/media/movies"
GET /stats Database stats
# Bulk update all movies from Radarr database
curl -X POST "http://localhost:8080/bulk/update"
```
GET /batch/status Current batch queue
### Testing & Validation
```bash
# Test database connections
curl -X POST "http://localhost:8080/test/bulk-update"
GET /debug/movie/{imdb_id} Debug movie import date detection
# Test movie directory scanning
curl -X POST "http://localhost:8080/test/movie-scan"
# System health check
curl "http://localhost:8080/health"
# Database statistics
curl "http://localhost:8080/stats"
# Batch processing queue status
curl "http://localhost:8080/batch/status"
```
### Debugging & Analysis
```bash
# Debug specific movie import date detection
curl "http://localhost:8080/debug/movie/tt1674782"
# Show complete import history analysis
curl "http://localhost:8080/debug/movie/tt1674782/history"
# Show date priority logic and available sources
curl "http://localhost:8080/debug/movie/tt1674782/priority"
```
### Response Examples
**Health Check**:
```json
{
"status": "healthy",
"version": "0.5.1",
"database_status": "healthy",
"radarr_database": {"status": "healthy", "movies": 1500}
}
```
**Movie Debug**:
```json
{
"detected_import_date": "2025-07-08T03:30:04+00:00",
"import_source": "radarr:history.import",
"movie_title": "Movie Name"
}
```
**Priority Logic Debug**:
```json
{
"movie_priority": "import_then_digital",
"priority_explanation": "1st: Radarr import history, 2nd: TMDB digital release, 3rd: file mtime",
"date_sources": {
"radarr_import": {"date": "2025-07-08T03:30:04+00:00", "source": "radarr:history.import"},
"digital_release": {"date": "2023-05-15T00:00:00+00:00", "source": "tmdb:digital"}
},
"selected_date": "2025-07-08T03:30:04+00:00"
}
```
📖 Example Workflow
You add The Blacklist in Sonarr.