feat: update maintarr payload
Local Docker Build (Dev) / build-dev (push) Successful in 5s

This commit is contained in:
2025-10-24 16:35:11 -04:00
parent e054c945ff
commit 7b62d73753
2 changed files with 31 additions and 6 deletions
+16 -5
View File
@@ -38,12 +38,14 @@ Copy and paste this JSON template into the "Json Payload" field:
{
"notification_type": "{{notification_type}}",
"subject": "{{subject}}",
"message": "{{message}} - IMDb: {{extra}}",
"message": "{{message}}",
"extra": "{{extra}}"
}
```
**Important**: Make sure to include the IMDb ID in either the `{{message}}` or `{{extra}}` fields for NFOGuard to identify the media. The webhook handler will extract the IMDb ID from these fields.
**Important Note**: Maintainarr's template variables may not include IMDb IDs directly. The webhook will attempt to extract IMDb IDs from the notification content, but this may require manual configuration or rule setup in Maintainarr to include IMDb IDs in the notification text.
**Alternative Approach**: If Maintainarr doesn't provide IMDb IDs in notifications, you may need to use NFOGuard's manual cleanup tools or configure Maintainarr rules to include IMDb information in the message content.
#### Event Types
Select these notification types:
@@ -148,18 +150,27 @@ INFO: Maintainarr cleanup: Media Removed - Movie 'Example Movie' (tt1234567). Re
### Common Issues
1. **Media Not Found**:
1. **No IMDb ID Found**:
- Maintainarr template variables may not include IMDb IDs
- Check if the notification message contains IMDb information
- You may need to manually include IMDb IDs in Maintainarr rule configurations
2. **Media Not Found**:
- Check if the media exists in NFOGuard's database
- Verify the IMDb ID matches between Maintainarr and NFOGuard
2. **Connection Issues**:
3. **Connection Issues**:
- Ensure NFOGuard core container is accessible on port 8080
- Check firewall settings and network connectivity
3. **Authentication Errors**:
4. **Authentication Errors**:
- No authentication is required for the webhook endpoint
- Ensure you're using the core container port, not web interface port
5. **Test Notifications**:
- Test notifications (like the one you just sent) will be acknowledged but not processed
- Real media removal events will trigger the cleanup process
### Testing the Webhook
You can test the webhook manually using curl:
+15 -1
View File
@@ -341,8 +341,22 @@ async def maintainarr_webhook(request: Request, background_tasks: BackgroundTask
print(f"INFO: Received Maintainarr webhook: {webhook.notification_type}")
print(f"DEBUG: Full Maintainarr webhook payload: {payload}")
# Only process media removal notifications
# Handle test notifications differently for debugging
notification_type = webhook.notification_type or ""
if notification_type == "TEST_NOTIFICATION":
return {
"status": "test_received",
"message": "Test notification received successfully",
"available_fields": {
"notification_type": webhook.notification_type,
"subject": webhook.subject,
"message": webhook.message,
"extra": webhook.extra
},
"debug": "This is a test notification. Real media removal events will be processed when they occur."
}
# Only process media removal notifications
if "removed" not in notification_type.lower() and "delete" not in notification_type.lower():
return {"status": "ignored", "reason": f"Notification type '{notification_type}' not processed"}