Skip to content

Change URL for internet radio api requests#1057

Closed
SteveMicroNova wants to merge 20 commits into
mainfrom
InternetRadioSearchFix
Closed

Change URL for internet radio api requests#1057
SteveMicroNova wants to merge 20 commits into
mainfrom
InternetRadioSearchFix

Conversation

@SteveMicroNova
Copy link
Copy Markdown
Contributor

What does this change intend to accomplish?

Internet Radio changed some server names it seems, this change points our API requests at the new server route

Checklist

  • Have you tested your changes and ensured they work? See on inhouse
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • If applicable, have you updated the CHANGELOG?
  • Does your submission pass linting & tests? You can test on localhost using ./scripts/test
  • Have you written new tests for your core features/changes, as applicable?

@SteveMicroNova SteveMicroNova linked an issue Sep 16, 2025 that may be closed by this pull request
// pinned this to fi1 since it appears to be the main server and the
// HTTPS cert isn't valid for all.api.radio-browser.info
fetch("https://at1.api.radio-browser.info/json/servers").then((res) =>
fetch("https://fi1.api.radio-browser.info/json/servers").then((res) =>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really just punting this problem down the road a bit. Should we fix it instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off the top of my head this should at least have a fallback url or 2.

An even more robust solution would be to get the list of servers from all.api.radio-browser.info using python, bypassing the js https issues, and resolve report that list somewhere in status/info. Then on the js side we could sample from that list with fallback?

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 50.21%. Comparing base (7499989) to head (fd222d0).
⚠️ Report is 80 commits behind head on main.

Files with missing lines Patch % Lines
tests/test_rest.py 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1057      +/-   ##
==========================================
- Coverage   50.67%   50.21%   -0.46%     
==========================================
  Files          40       41       +1     
  Lines        7154     7362     +208     
==========================================
+ Hits         3625     3697      +72     
- Misses       3529     3665     +136     
Flag Coverage Δ
unittests 50.21% <0.00%> (-0.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SteveMicroNova
Copy link
Copy Markdown
Contributor Author

SteveMicroNova commented Sep 24, 2025

I would say this is now Pretty Good(tm) but still needs some work

Namely, I put the server finding stuff in the utils file because I can see a world where none of the servers work and you need to refresh it, I don't know what to do for that (i.e., add some endpoint that does it, have the list refresh every week-ish, just direct users to restart their device if they complain about it if they somehow haven't restarted their device in years at a time)

Secondarily, I also need to plug this in through the tests.

Comment thread amplipi/ctrl.py
if zupdate.name:
# ensure all zones don't get named the same
zupdate.name = f'{zupdate.name} {zid+1}'
zupdate.name = f'{zupdate.name} {zid + 1}'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My linter automatically added spaces around all of the + in this file and I didn't care to correct it and preserve the proper blame. If we care to do that, I'll do that once this PR is otherwise approved so I don't have to do it with every single linting run locally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future git commit --interactive is great for commit portions of a file

@linknum23
Copy link
Copy Markdown
Contributor

We talked recently about this being a script that gets called every X days via cron. I assumed that script would output a json file somewhere and that file would be read by amplipi at startup.

@SteveMicroNova SteveMicroNova mentioned this pull request Oct 22, 2025
5 tasks
@SteveMicroNova
Copy link
Copy Markdown
Contributor Author

Closing due to discovering this to be a massive overcomplication that has been solved in #1060 instead

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.

Internet radio search doesn't produce any results

3 participants