fix(#298): only treat audio enclosures as podcast URLs in APIXMLParser - #320
Merged
cassio-rossi merged 2 commits intoJul 27, 2026
Merged
Conversation
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]>
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
<enclosure>element with the featured image on every item (not just podcast episodes), whileFeedViewModel.search()classified any post with a non-emptypodcastURLas a podcast — so every search result was misclassified as a podcast.APIXMLParsernow only populatespodcastURLwhen the enclosure'stypeattribute starts withaudio/, matching the real podcast feed'stype="audio/mpeg"enclosures.Test plan
podcastURLstays empty; audio enclosure →podcastURLpopulatedFeedLibraryTests(incl.XMLParserTests) — 10/10 passedFeedLibraryTests+SearchLibraryTests— 44/44 passedxcodebuild build— succeededswiftlint --stricton changed files — 0 violationsCo-Authored-By: Claude [email protected]