Add a read-only podcast lookup endpoint - #987
Merged
dannyvfilms merged 3 commits intoAug 25, 2026
Merged
Conversation
- Restores `ruff check src` to zero, which had been failing on a single I001 since the tmdb-backdrops-api merge (7a47eec). - Import order only, no behaviour change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- GET /api/v1/podcasts/lookup/{itunes_id}/ previews an iTunes search result
before anything is imported, returning show metadata plus the feed's
episodes in the standard limit/offset envelope, and `show_id` for the
show an import would reuse.
- Shares the import path's metadata resolution and dedupe through two new
helpers in podcast_import, and caches the feed read for 15 minutes so
paging through search results does not re-download it.
- Registers the route in the schema-finding allowlist and the auth-coverage
endpoint cases.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8 tasks
- The unreachable-provider branch of ProviderAPIError builds its message from the underlying exception, so returning str(error) exposed it to the caller. Reports the provider label alone, matching the provider-search handler in views.py. Flagged by CodeQL py/stack-trace-exposure. - Adds a regression test asserting the failure body carries nothing else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/v1/podcasts/lookup/{itunes_id}/, a read-only preview of an iTunes podcast search result. It returns the show metadata and the feed's episode list without creating a PodcastShow or a PodcastEpisode, so a client can show someone what a podcast is before they decide to track it.show_idwhen the podcast is already in the library, using the same feed-then-uuid match the importer uses, so a client can tell "add this" apart from "already added".resolve_show_metadatanow returns a new dict rather than quietly writing author and language back into its caller's data.safe_urlbefore being logged, because private podcast feeds carry access tokens in their query string.src/api/serializers.py.ruff check srchad been failing on that one I001 since the tmdb-backdrops-api merge, and this restores the lint baseline to zero.AI Assistance
claude-opus-5How It Was Tested
Local
uvis pinned to a version this machine does not have, so these ran through the venv interpreter directly. They are thescripts/test.shruns with the same tag exclusions.SECRET=test-only PYTHONPATH=mcp_server .venv/bin/python src/manage.py test api app.tests.test_api_contracts --parallel --buffer --exclude-tag slow --exclude-tag network-> 595 tests, no failures. Two errors, bothModuleNotFoundError: pyld, which is a stale local venv rather than a code problem, sincepyld==2.0.4is declared inpyproject.toml.api.tests.test_fork_podcast.PodcastLookupTests, 9 tests: whole-feed read, pagination envelope, already-importedshow_id, RSS description fallback, cache hit, missing feed URL, unreadable feed, unknown id 404, and provider outage 500..venv/bin/ruff check src-> All checks passed.src/api/contracts/openapi.yaml-> byte identical. The static artifact is the verified MCP subset, and this route is not in that subset, so it produces no diff. The finding allowlist inschema_contract.pyand its count assertion were updated instead.Public API & Documentation Handoff
python -m app.domain_vocabulary --check)Human Review & Quality Assurance
/gstack-qaor browser testing)Database & Migration Safety (Only if modifying models)
uv run --no-sync python src/manage.py check_migration_hygiene --strict)Related Issues
#986