Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

radio/v1 package

Overview

Package radio is GnoRadio's radio rules, release 1: a main station that plays the whole catalog through the genre stations, one station per genre, "New this week" (the newest tracks) and "Listeners' choice" (the tracks listeners picked). Everyone tuned to a station hears the same track at the same second, computed from block time; no streaming server is involved. Between picks the main station simulcasts one genre station an hour, by the time of day (flow.gno); it has no rotation of its own.

Each station has a rotation (every playable track of its genre, looping) stored in fixed-size blocks so that every operation costs the same whatever the catalog size, and a short schedule of tracks programmed by listeners. While a programmed track plays the rotation pauses, then resumes where it was. Adding, removing or editing a track never makes listeners jump.

It keeps no state but its admin role. Every record lives in the data realm (gno.land/r/nym-alexiscolin000/gnoradio/data), in the "radio/…" collections only the current radio writer may change (db.gno). It reads the catalog through its value getters; sponsored picks are paid from data's vault through the catalog.

Function

ScheduleJSON

func ScheduleJSON(stationID, horizon int) string

ScheduleJSON returns what a station plays from now until now+horizon seconds (60..7200, at most 60 entries): programmed slots and the rotation between them (on Main, the hour's genre station, simulcast and cut at each hour). A client plays entry i from offset+max(0, clock-start) and resyncs on "now". "relay" marks, on Main, an entry that is not Main's own slot but the hour's genre station simulcast (its picks included). "sponsored" is the refund its artist pays the picker (0: a normal pick), "at" the time a booked pick asked for (0: none). "booked" lists every booked pick still to air, whatever the horizon, and those that aired in the last hour (they count toward their clock hour's cap until they fold): {"track","start","end","at","by","note"}. Fetch it again every few minutes, not every second.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-alexiscolin000/gnoradio/radio/v1.ScheduleJSON(,)"

Result