Skip to content

Commit cbc7d0a

Browse files
dannyvfilmsclaude
andcommitted
Fix season resolution crash and sanitize API exception leaks
- resolve_or_create_season now guards against non-dict season metadata instead of raising AttributeError when a provider returns a malformed payload (fixes the root cause behind #957) - Sanitize the ~40 remaining "errors": str(e) sites in api/views.py that leaked raw exception text to API clients, matching the pattern already used for the episode watch/drop routes; exceptions are now logged server-side via logger.exception instead Fixes #957 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 42d2b71 commit cbc7d0a

4 files changed

Lines changed: 142 additions & 82 deletions

File tree

src/api/tests/test_media_core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,8 @@ def test_media_detail_get_provider_failure_remains_internal_server_error(
933933
)
934934

935935
self.assertEqual(response.status_code, 500)
936-
self.assertEqual(response.data["errors"], "boom")
936+
self.assertNotIn("errors", response.data)
937+
self.assertNotIn("boom", response.data["detail"])
937938

938939
@patch("api.views._queue_game_lengths_refresh", return_value=True)
939940
@patch("api.views.services.get_media_metadata")

0 commit comments

Comments
 (0)