Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use country code instead of language for top itunes feed #3778

Closed
wants to merge 2 commits into from

Conversation

tonytamsf
Copy link
Member

@tonytamsf tonytamsf commented Jan 24, 2020

fix #3777

In the itunes store, the top RSS feed is not based on language, it's based on country.

This fixes all countries where the language code is not equal to country code when you switch the default language on the phone (Chinese, Candian, Indian English, Switzerland.. etc)

To test

  1. change your phone's language to India English
  2. the previous version in ItunesTopListLoader.java calls the invalid URL
    https://itunes.apple.com/en/rss/toppodcasts/limit=8/explicit=true/json which would be HTTP 400 then fall back to US version
    https://itunes.apple.com/us/rss/toppodcasts/limit=8/explicit=true/json

My PR calls the correct URL which uses IN, iTunes doesn't support language based toppodcasts, only country base
https://itunes.apple.com/IN/rss/toppodcasts/limit=8/explicit=true/json

You can see the debug logs

Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
D/AntennapodHttpClient: Creating new instance of HTTP client
D/AntennapodHttpClient: Creating new instance of HTTP client
D/ITunesTopListLoader: Feed URL https://itunes.apple.com/IN/rss/toppodcasts/limit=8/explicit=true/json

And the browsing/discovery shows India Podcasts

Screen Shot 2020-01-23 at 9 52 33 PM
Screen Shot 2020-01-23 at 9 52 25 PM

@tonytamsf
Copy link
Member Author

@ByteHamster thanks for the thorough code review, done with fixing. ready for your review again.

@ByteHamster
Copy link
Member

Merged to master in 3bbe6d5

@antennapod-bot
Copy link

This pull request has been mentioned on AntennaPod Forum. There might be relevant details there:

https://forum.antennapod.org/t/podcast-index-namespace-work/420/12

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.

Discover feeds mostly fall back to 'us' incorrectly
3 participants