-
Notifications
You must be signed in to change notification settings - Fork 96
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
Fixed Radiobrowser - Access Error issue on some models #79
base: master
Are you sure you want to change the base?
Conversation
…ngs, to work with some older radios - Fixed radiobrowser service stations/byuuid/ REST method name - Version bumped to 1.1.1
ycast/radiobrowser.py
Outdated
@@ -61,14 +64,15 @@ def request(url): | |||
|
|||
|
|||
def get_station_by_id(uid): | |||
station_json = request('stations/byid/' + str(uid)) | |||
station_json = request('stations/byuuid/' + str(id_registry[uid])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already fixed in #77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly, because this line is changed to fetch the original UUID from the registry - str(id_registry[uid]) instead of just str(uid) :
station_json = request('stations/byuuid/' + str(id_registry[uid]))
@@ -13,6 +13,7 @@ | |||
SHOW_BROKEN_STATIONS = False | |||
ID_PREFIX = "RB" | |||
|
|||
id_registry = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's that for? We can use self.id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we can't because the Access Error issue was caused by ID size limit to 15 chars in some radios. That's why we have to translate UUID (36 chars) to a fairly unique ID that will fit the limitation. Currently it is 12 chars, because with the prefix "RB_" it comes to exactly 15 chars.
I am using this dictionary in memory to avoid reading fetching the stations all over again from the remote service. While my_stations reads the stations all over again from the file, calculates ID and matches it on the fly, there are usually much more stations returned by the radiobrowser and going there twice just to find a matching UUID would be really slow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand.
Can we split this cache speed improvement off of the functionality fix? Would be nice for testing and traceability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry, I am not quite sure what you meant by that. There is no "cache speed improvement" here. Just keeping the ID-UUID dictionary of the last search response. How else would you be able to find the original station when the radio returns an ID that is nothing but a digest value that you calculated from the original station UUID?
The id_registry is absolutely necessary for this fix to work.
Thanks for your work 👍 I've annotated a few things for you. The main fix is the shortening of the ID. Am I getting this right? |
Exactly. Tested and working on my ancient V477. |
Hello I tested version 1.1.1 with my Yamaha NP-S2000. The following result: Operation directly on the Yamaha NP-S2000: Operation via the “NP controller” APP does not work. If I use the search function on the iPad (IOS), all listed stations can be played. I'm not a Phyton programmer, who can help? Suspect missing code in the APP part (Translate UUID into shorter strings) Thank you for the great work so far. Regards K. Hagena - Germany |
@milaq this might be an off-topic question, but why the File server.py: |
I don-t have the NP Controller, but AV Controller, which are two branches of the same Yamaha app for different radio models. While browsing and playing on my RX-V477 works fine now, I noticed that on "AV Controller" app when browsing through categories list gets stuck somewhere after 1970's. I guess that might be an encoding problem that I'll look into. But definitely that's a different issue. |
- Corrected logging levels for some entries - Added oyaml into setup.py
Version back to milaq's 1.1.0
since the upgrade to the RB uuid-API i had problems with my "old" RX-V777 using RB, tested with the lastest commits. In the past time we already had the 15 char problem with some old receivers. I tried just jonnieZG's code with my receiver and RB does work now! |
I don't know why my changes are not merged into the main project, but I use it anyways since it works great, and I am not bothering with that. I will keep improving my version as I see fit and you are welcome to use it. |
I can confirm this fixes the radio browser access error on Yamaha RX-A2010 (#77 does not) - the list of countries does not load fully though (stuck at Loading ...) - the same for other submenus under Radiobrowser->xxx->... |
Hello @milaq, Thanks. |
Can confirm this made it work again, have three RX-V679, and a RX-V481D. |
I would really like to try the JonnieZG version of Ycast to my rx-v577 |
Hi,
To adapt to your directory tree. |
Thank you, i'll give it a go and let you know |
pip3 uninstall ycast does ist for me.... Yamaha DSP-Z7 again tested a few minutes ago. (thanks to milaq and jonnieZG) |
Try that too, if everything else fails. |
Problem is still there.. |
Thank you very much, my method was really barbaric. |
My actual Setup is nginx Proxy on debian 11 bullseye arm64 on a proxmox lxc container, together with unbound and pihole. The Rest of the Setup is completely Same as described By milaq for nginx.
|
After testing several builds that of jonnieZG suits me best. |
Tried all of the above, sadly its not working for me. |
I can not estimate how good your knowledge in routing Linux ... DNS.. etc... I am happy to help over a remote session if I can. But i'm do not Programming in Python.. But, have also a Yamaha Setup Running Fine. Mine is a Network/receiver 2.0 |
Thank you for you offer, |
When I got interested in YCast I didn't know anything about raspberry and even less about linux. Today I am happy with what I learned at my age. |
@zofman I had the same problem here
...
...
I just reinstalled ycast 1.1.0 and some dependencies via
|
Thank you both guys, milaq and jonnieZG. |
Yamaha rx-v477 access error. |
Fixed issues: