Skip to content

Discover: episode search, search filters, sub-category and trending charts - #119

Merged
Niall-Faughnan merged 1 commit into
developfrom
claude/big-tech-show-recency-bug-vugfmb
Oct 28, 2026
Merged

Niall-Faughnan merged 1 commit into
developfrom
claude/big-tech-show-recency-bug-vugfmb

Conversation

@Niall-Faughnan

Copy link
Copy Markdown
Collaborator

Summary

Discover now uses more of Apple's free iTunes / Marketing Tools APIs. Before writing any code, I checked each endpoint against Apple's live servers.

Search

  • Episode search. A Shows / Episodes chip pair appears under the search box. Episodes uses entity=podcastEpisode, so a guest's name finds every show they appeared on.
    • Tapping a result stores its show as an unsubscribed preview if needed, then finds the episode by GUID, else by audio URL or normalized title.
    • It then opens the episode's page, which keeps the single download-then-play button (CLAUDE.md download-first rule). There's no play button in the results.
    • If the feed no longer lists the episode, it falls back to the show's page.
  • Field filters for show search: Anywhere / In title (attribute=titleTerm) / By host (attribute=artistTerm). Changing a filter re-runs the query immediately.
  • Storefront and size. Searches use the chart region's storefront (country=) and ask for 100 results instead of 30. iTunes returns at most 100 podcasts.

Charts

  • Sub-categories. The full Apple category tree is included: 19 categories and 91 sub-categories, from Apple's genre service. A second chip row appears for the selected category (e.g. Sport → Rugby, News → Politics). This also adds the six top-level categories Podbelly lacked: Arts, Fiction, Kids & Family, Leisure, Religion & Spirituality and Government.
  • Top 200 instead of 25. A single batched lookup still resolves all 200 feed URLs (checked live).
  • Trending episodes chart per region, from rss.marketingtools.apple.com/api/v2/{cc}/podcasts/top/50/podcast-episodes.json. Entries carry only an Apple Podcasts link, so their shows are resolved with one lookup of the show ids in those links. Lookup by episode id returns nothing.

Smaller changes

  • onPodcastClick's preview-storing code is now shared with episode taps (storePreview, RssEpisode.toEntity).
  • A search cancelled by a newer query or filter (collectLatest) now rethrows CancellationException. It no longer shows a "Search failed: …cancelled" snackbar.
  • Version 1.6.75 (123) → 1.6.76 (124), with What's New entries.

AntennaPod uses the same two iTunes endpoints (toppodcasts RSS plus lookup) in ItunesTopListLoader.

Tests

  • DiscoverViewModelTest: updated the search(...) stubs for the new parameters. New tests:
    • episode-scope search;
    • re-running the query when the field filter changes;
    • storefront country;
    • sub-category chart plus the cached "All";
    • category tree shape (21 chips, 91 sub-categories);
    • trending chart;
    • opening a stored show's episode by GUID without a fetch;
    • opening a trending episode of a new show (stored unsubscribed, matched by title).
  • PodcastSearchRepositoryIntegrationTest (MockWebServer):
    • attribute, country and limit params;
    • episode result mapping and dropping results without a feed;
    • a malformed release date.
  • New PodcastSearchRepositoryTrendingTest (mocked API): show resolution in one lookup, chart order preserved, unresolvable entries dropped, and no lookup for an empty chart.

Testing

Local compilation could not be run: Gradle can't resolve dependencies in the agent environment. The CI build check (all unit tests plus assembleDebug) is the compile check for this PR.


Generated by Claude Code

…harts

Uses more of Apple's free iTunes / Marketing Tools APIs (all verified live):

- Episode search (entity=podcastEpisode): an "Episodes" chip under the search
  box lists matching episodes across every show. Tapping one stores its show
  as a preview if needed, finds the episode (by GUID, else audio URL or
  title) and opens its page, which keeps the download-then-play button.
- Show search filters: "In title" (attribute=titleTerm) and "By host"
  (attribute=artistTerm) beside "Anywhere".
- Searches use the chart region's storefront (country=) and ask for 100
  results instead of 30.
- Sub-category charts: the full Apple category tree (19 categories, 91
  sub-categories, e.g. Sport -> Rugby) as a second chip row; picking a
  category adds the six it previously lacked.
- Charts show the top 200 instead of 25 (one batched lookup still resolves
  every feed URL).
- A "Trending episodes" chart per region from rss.marketingtools.apple.com;
  entries carry only an Apple Podcasts link, so shows are resolved with one
  lookup of the show ids in those links.

onPodcastClick's preview-storing code is shared with episode taps. A search
superseded by a newer query or filter no longer surfaces as a "Search
failed" snackbar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RK5hqcE13d42xpsT576dRw
@Niall-Faughnan
Niall-Faughnan merged commit d1c165f into develop Oct 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants