I’ve been listening to to Gensokyo Radio off and on for months and really enjoy tuning in. I’ve learned about many circles I never would have learned about or listened to alone.
Recently, I’ve noticed some strange behavior when it comes to displaying how far into the song I am. The end of the song and end of the display bar appear to be desynced in that the song will end and the next one will start but the bar doesn’t reach the end and update the music info until roughly between twenty seconds and upwards of a minute later. The duration bar also frequently starts towards the end and then wraps back around during the same song.
I’ve seen this behavior on multiple computers and I wasn’t sure if this issue was already known. As a whole, its difficult to explain it without any images. I could try to get a short clip of the behavior if requested.
Hey there Super,
This might be something you’re seeing on the website’s player. There are a couple underlying reasons for this, with one being a relatively easy fix, and the other a not-so-easy fix.
Problem 1 (Easy)
Client-side (in a browser), I’ve seen it happen where the song may have changed on the station but the duration bar in the player hasn’t yet reached the end of the previous song. If I refresh the page, it might change to the correct song and the duration will be correct for a second before reverting back to the previous song’s time. In this case, there’s a variable that needs to be updated on page reload that isn’t. It’s a simple fix, and one that’s overdue.
Problem 2 (Difficult)
The more difficult case to fix has to do with our recent change in how logging works server-side. We swapped over to a much more efficient logging method which reduces calls to the database and reduces overall server load. To do this, we took a script that used to run every 3 seconds and trimmed it down to only the parts responsible for connection logging.
One part that was removed had to do with song logging. We replaced it with a function which receives a message from the station whenever a new song starts. This “message” is real-time but limited, providing only the title and artist of the song, and we attempt to match that information to a song in our DB to retrieve a song ID which is critical for logging exactly what song has started. If it fails to find the song based on this limited information, we fallback to the legacy script which runs every minute (instead of every 3 seconds) to catch these cases. Because of this, you might find songs that are many seconds off between the website’s player and when songs actually begin playing on the station.
tl;dr, there is room for improvement in some server-side code that controls when song information is updated.
Other than that, I’m glad you’re enjoying the station, and hopefully we’ll get this playback thing sorted out soon!