How to best display current show?

Max asked on Bitbucket:

How do you best recommend showing the current show like we do for KSPC here and KZSC here? Right now we’re using a stripped-down version of the upcoming-shows widget because we had issues with the now-playing script pulling in only the currently scheduled show. Maybe we’re over-complicating things, but there were issues with the differences in code when there’s an active playlist vs a scheduled show that’s not logging.

To display the current show a stripped down upcoming-shows widget with count=1 and current=1 is the right way to go.

But bear in mind that at the moment a browser loads the web page

  1. There may be zero, one or more occurrences of scheduled shoes that have begin but not ended.
  2. There may be zero, one or more playlists with their own distinct metadata (inc. title) that have begun but not ended.

In Spinitron, shows scheduled in the calendar represent intent or plans while playlists represent record keeping. A playlist is a document/log of what happened suitable for copyright reporting and other legal purposes. The schedule is used to communicate roughly what to expect to listeners and station staff.

Some stations are quite disciplined in keeping a complete and unambiguous schedule but even they are not likely to always update the schedule so it represents all near term changes, e.g. when DJs cover each others’ shifts or what happens over spring break. It’s perfectly normal that things are not running precisely to schedule and it is normal that a current playlist represents what’s really happening. So…

To display the current playlist … we don’t have a way to do that with a JS widget. You can display the title and on/off air times of the playlist with the most recent spin with the now playing widget using num=1 and meta=1. But the playlist with the most recent spin may have ended. (Actually it’s hard to know if a program has in fact ended because it’s common for a DJ to keep running and logging spins after the planned time slot end. A new spin might arrive at 15 minutes after its playlist’s end time – would that make it the current playlist? if so, after how much longer does it stop being current?)

The best we have managed to find a logic that works reasonably well across stations is used on the station landing pages on Spinitron in the “On air” block. It was discussed at length on a Bitbucket issue before we implemented it. I’ll try to find a link but it’s my bed time now.