Skip to content

fix(#298): only treat audio enclosures as podcast URLs in APIXMLParser - #320

Merged
cassio-rossi merged 2 commits into
release/v5from
fix/search-feed-podcast-misclassification
Jul 27, 2026
Merged

fix(#298): only treat audio enclosures as podcast URLs in APIXMLParser#320
cassio-rossi merged 2 commits into
release/v5from
fix/search-feed-podcast-misclassification

Conversation

@cassio-rossi

Copy link
Copy Markdown
Collaborator

Summary

  • WordPress's search feed emits an <enclosure> element with the featured image on every item (not just podcast episodes), while FeedViewModel.search() classified any post with a non-empty podcastURL as a podcast — so every search result was misclassified as a podcast.
  • APIXMLParser now only populates podcastURL when the enclosure's type attribute starts with audio/, matching the real podcast feed's type="audio/mpeg" enclosures.

Test plan

  • Added regression tests: image enclosure → podcastURL stays empty; audio enclosure → podcastURL populated
  • FeedLibraryTests (incl. XMLParserTests) — 10/10 passed
  • FeedLibraryTests + SearchLibraryTests — 44/44 passed
  • xcodebuild build — succeeded
  • swiftlint --strict on changed files — 0 violations

Co-Authored-By: Claude [email protected]

cassio-rossi and others added 2 commits July 27, 2026 23:18
WordPress's search feed emits an <enclosure> element with the featured
image on every item, not just on podcast episodes. APIXMLParser stored
podcastURL from any <enclosure> regardless of its type attribute, so
FeedViewModel.search()'s podcastURL.isEmpty check classified every
search result as a podcast. Now only audio/* enclosures populate
podcastURL.

Co-Authored-By: Claude <[email protected]>
Search results parse categories without injecting a feed-specific
filterKey, so the raw XML category text (the Portuguese rawValue,
e.g. "Destaques") never matched filterKeyToCategory, which only knew
about filterKey strings like "NewsCategoryHighlights". Every search
result fell back to .all and lost its highlights/rumors/reviews/etc.
card styling. Matching on rawValue too fixes this, and the lookup is
deduped since a regular feed's array can now match a category twice
(once via the injected filterKey, once via the real XML text).

Co-Authored-By: Claude <[email protected]>
@cassio-rossi
cassio-rossi merged commit be1ad83 into release/v5 Jul 27, 2026
2 checks passed
@cassio-rossi
cassio-rossi deleted the fix/search-feed-podcast-misclassification branch July 27, 2026 22:32
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.

1 participant