MortyG · Radio
G-FM – MortyG's radio
The night-drive station. Songs by MortyG, jingles, DJ talk and made-up ads between the tracks.
G-FM is off air right now. Press “Turn on G-FM” and keep this page open, and the sound starts when the broadcast begins.
Now playing
G-FM
The station is quiet right now
Tech Talk
Small parts. Clear responsibilities.
G-FM is MortyG's own radio station for live streams. Songs and short spots – station IDs, DJ talk, made-up ads and promos – take turns: song, spot, song, spot. The record crate is the same one the Music page uses, so any new crate feature reaches both, but G-FM keeps its own track list: switching a song on here never changes what the Music page shows.
Visitor analytics and click tracking are turned off. Optional browser storage now waits for the visitor’s answer: one shared helper keeps language, curtain and similar choices in memory for the visit, and writes them to localStorage only after “Remember my choices”; the offline service worker and Cache Storage start only after “Offline use”. Rejecting removes saved choices and offline files. The answer itself, sign-in sessions and Cloudflare’s short ‘__cf_bm’ security cookie are treated as necessary; that cookie arrives with the first response from the hosting network, before any question can be shown, so it is disclosed openly rather than asked about. The Privacy & cookies page lists every stored item and every outside service (Cloudflare, Lovable, Google Fonts, OpenAI and Google for Ekorn, Spotify) with links to their own privacy policies. The opening curtain follows the same answer everywhere, including the Home Screen icon: without a yes it shows on every new visit. The language button names the language it switches to (“Switch to English” / “Bytt til norsk”), so it is not mistaken for the language already shown. This is a design choice, not a compliance certification. The record crate on the Music page shows only the records the owner has switched on: the choices live in one small table where visitors can read only the records switched on, so hidden records and their names stay private; only the admin role can see and change every choice, and every record stays hidden until switched on. Covers are web-sized copies on the CDN, and the sliding vinyl is a flat layer behind the sleeve, so it never cuts through the sleeve as it turns. Below the crate, a Spotify section links straight to MortyG’s verified artist page; Spotify’s own artist player loads only after the visitor presses play, and the Spotify icon is shown unchanged in Spotify green, as Spotify’s design guidelines ask when linking to Spotify content. A note at the top says the Music page is still under construction and jumps to the listening section, which also links to MortyG’s artist pages on Apple Music, Deezer and iHeartRadio. Those are plain text links, checked against each service before adding, so nothing connects to them until a visitor clicks; Tidal, Amazon Music and YouTube Music are added once their artist links are confirmed. The top bar has one account button that reads its label from the live sign-in session: “Log in” when signed out, “Log out” when signed in. Logging out clears everything cached while signed in, then shows the same page as a visitor; on private pages it goes to the home page instead. Next to it, the owner sees a gold Admin shortcut and invited customers see “My workspace”; visitors see neither. The Admin home is a map with one tile per owner tool, read from a single list so a new tool is added in one place; the tools stay where they work, and each still checks the admin role in the database itself, so the shortcuts change only what is shown, never who can open or change anything.
Security & privacy
Everyone can see what is on air. Only the admin role can change the station: the track list, the play state and uploads are protected in the database itself, not just hidden in the page. The audio files sit in a private storage area; the playing page asks for short-lived links. OBS does not need a sign-in: each OBS browser source gets its own player key – a long random code at the end of its address that only the admin can see, make or delete. The website's server checks the key on every request. A station key may only read the switched-on tracks, get a short-lived link to one of them, and write four things – what is on air, when it started, the queue and play/pause – nothing else, and only while it is the station player. A relay key can only follow the live broadcast, like a listening link. The OBS page checks its key again every minute, so a deleted key stops within a minute; the key is never shown on screen and the page never passes its address on to other sites. Signing in as admin in OBS still works too. Covers live in their own private storage area that visitors cannot open directly: the website’s server hands out short-lived links only for covers attached to a switched-on track, so replaced, leftover or hidden covers stay private, and only the admin can upload, replace or remove them. Visitors can read only the single on-air station record. Nothing is uploaded or changed by visitors. Private listening links are long random codes that only the admin can see, make or delete. When someone opens one, the website's server checks the code and then hands out a short-lived link to the one track that is on air right now – never another track, and nothing at all while G-FM is off air – so a listening link can only ever play the live broadcast. The G-FM page itself now follows the same rule for every visitor: pressing “Turn on G-FM” asks the server for the track on air only – nothing while off air, never another track, and only switched-on tracks – so the public page can play the live broadcast without opening the rest of the audio library. Deleting a link stops it at once. The link page is kept out of search engines and never passes its code on to other sites; the only thing noted is when a link was last opened.
Maintenance
The smart shuffle lives in one small, separate module with its own tests: songs play in loops where every song plays once and Grand Theft Love exactly twice, half a loop apart and kept well apart across loops too; each loop is reshuffled so the order never repeats; two songs by the same artist never play back to back, also across the loop boundary, and when the artists make that impossible the loop with the fewest repeats is used so the music never stops. Each song has an artist chosen on the studio desk (Morty G or one of the AI personas), and Now playing shows the artist, with “AI persona – OTKO” for the personas. Spots are shuffled like a deck so each plays once per round, ads never back in the same order as last round, and the sign-off only when the admin ends the broadcast. Playback runs in the OBS page; the studio desk sends commands through realtime, so it works from a phone or a second screen. Only one OBS page runs the station at a time: each one that opens takes over by writing a random player id into the station record, and any other station player that sees a new id stops its sound and shows which OBS player G-FM is running on, so there is never double sound. Every place G-FM shows a track – the Now playing card, the crate, the OBS overlay and the desk – picks its cover the same way: the cover uploaded for G-FM first, then the matching record cover from the crate, and otherwise the official G-FM badge, shown whole on its transparent background so the G-FM text is never cut off. Spots – station IDs, DJ spots, ads, promos and the sign-off – can get their own cover from the studio desk too, with the same upload, preview and remove; without one they show the badge. Uploaded covers are shrunk to web size in the browser before they are stored. When a song shows its own cover, the G-FM badge sits on its corner like a TV station mark, so every Now playing card shows it is G-FM. Listeners on the G-FM page or a private link join the track at the same point as OBS: the OBS page writes down when the sound really started (again after every pause), and the listener's browser starts that far in, pauses when the station pauses and waits quietly while G-FM is off air. Stuck broadcasts are ruled out: while an OBS station player runs G-FM it sends a small “still here” sign every 20 seconds. If OBS is closed or crashes, the sign stops, and within 90 seconds the G-FM page, listening links, relays and the desk all count G-FM as off air – the server then hands out no audio at all. “End broadcast” stops at once when no OBS page is open to play the sign-off, “Take off air now” on the desk always stops everything straight away, and if no track can play the station goes off air by itself instead of standing silent.
Low AI cost
No AI runs on G-FM. The station plays files Morten uploads himself, so the only costs are normal hosting, storage and streaming of those files.
Possible next steps — not available yet
- Upload the M4A files for every song and spot – until then, tracks without sound are skipped.
- Covers for Grand Theft Love, Born In Beverly Hills, Still G and The Hill – they can now be uploaded from the studio desk; until then the G-FM badge stands in.
Architecture drawing · G-FM
Studio desk (phone or PC) → realtime → OBS page plays the station
- 01
Studio desk
Admin only: play, pause, skip, play next, end broadcast, artists and uploads.
- 02
Shared station state
One small record: what's on air, the queue and play/pause, sent out live.
- 03
Rotation engine
Song, spot, song, spot – shuffled loops, no artist twice in a row, shuffled spots.
- 04
OBS page & crate
Plays the private audio, shows Now playing and rolls the crate to the record on air.
