Status update about the changes incoming to radio.dubbeh.net.
The whole php code has been pretty much recoded from scratch and is now much more stable overall as a codebase. The intial release was my first real project coded under the PHP language, so there was many methods i was using that wasn’t practical and messy for sure.
The first stage of the recoding process was rewriting the updater to grab the latest stations and add them to the database, this surprisingly took a lot of trial and error because the API itself is quite unstable at times (So i had to add extra checks for invalid results and then retry if the response wasn’t 200/Ok – capped at 10 retries).
Take the way you need to grab the playlists:
To tune into a station, find the “id” of the station from the API results & make a call to http://yp.shoutcast.com<base>?id=[Station_id] by appending the station id.
Problem here is the server on yp.soutcast.com appears to get a lot of requests and sends a 404 error when there is too many at once, which happens a lot. So to overcome this you need to retry and check the response for 200. The old method was only running 1 query without any retries, so you can imagine how many stations wasn’t getting added to the database because of bad responses.
Another major change is pre-checking mount points during the backend update process, which is 1000 times faster over the previous method of checking them in almost realtime, and caching the header response.
All the backend code is done now and everything is backwards compatible with the old query methods inside the Radio plugin.
If anyone has any questions or comments feel free to post below or contact me through the contact page above. Would love some feedback about releasing the updated radio player now and adding the UI/UX features over time.