sknob/music v5.2 Release Notes, Radio sknob Edition!
Introducing... Radio sknob!
If you read the preceding #coding posts, you know I finally decided to redo my antiquated site before it stopped working, and that I recoded everything from scratch.
And now, I’m actually free to start adding new features.
This release introduces an oft requested “radio mode”, i.e. a way to listen to everything, not just to single albums (as the artist originally intended 😭).
- There is now a
shuffle buttonradio button, which toggles between album mode and radio mode. - The radio mode is reshuffled on each toggle.
The radio mode doesn’t display the full lyrics, but does display the track background info, so you can download a song you like, or copy the link, or boost the song on the fediverse.- Other than that, Radio sknob behaves like a regular album, which means you can click on the 🔗 icon next to the title to get a link to open the site in radio mode.
- Oh, and there’s also a keyboard shortcut to switch between album and radio mode. You’ll find it in the about dialog, along with other useful shortcuts 😇.
Hope you like the new feature (you know who you are...)
A few gory details...
I’m sure there’s a lighter and easy-ish way to do this in javascript, cloning arrays, etc., but my XML data file weighs about 300 Kb, so I decided to just transform it twice with two different XSL templates. Zero code. I do shuffle the radio playlist in javascript however.
I’m not sure the final size of the page would be lighter if I used javascript, but using XML+XSL transformed on the server using PHP does impact page load. This bugs me, but the site still loads pretty fast, so I’m choosing to go with this for now. If I get my javascript chops up in the future, I might recode this entirely.
UPDATE: of course, I couldn’t resist optimizing the page load, so I now only load the XML playlist once, and build the radio playlist locally in javascript...
I also tried a gazillion different interfaces/UIs until I worked my way down to this one which is minimal and consistent, which is what I always strive for.