Change URL for internet radio api requests#1057
Conversation
| // 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) => |
There was a problem hiding this comment.
This is really just punting this problem down the road a bit. Should we fix it instead?
There was a problem hiding this comment.
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 Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
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. |
| 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}' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
In the future git commit --interactive is great for commit portions of a file
|
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. |
…testing to avoid null comparisons
…ting that isn't failing locally
…this on the backend
|
Closing due to discovering this to be a massive overcomplication that has been solved in #1060 instead |
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
./scripts/test