<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>THRILLHOUSE</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  </head>
  <body><h1 id="header">Welcome to THRILLHOUSE</h1><div id="menu"><ul><li><a href="admin/">Administration</a></li><li><a href="status.xsl">Server Status</a></li><li><a href="server_version.xsl">Version</a></li></ul></div>
	<!-- WARNING:
	 DO NOT ATTEMPT TO PARSE ICECAST HTML OUTPUT!
	 The web interface may change completely between releases.
	 If you have a need for automatic processing of server data,
	 please read the appropriate documentation. Latest docs:
	 https://icecast.org/docs/icecast-latest/icecast2_stats.html
	-->
	<div class="roundbox"><div class="mounthead"><h3 class="mount">Mount Point /thrillhouse</h3><div class="right"><ul class="mountlist"><li><a class="play" href="/thrillhouse.m3u">M3U</a></li><li><a class="play" href="/thrillhouse.xspf">XSPF</a></li></ul></div></div><div class="mountcont"><table class="yellowkeys"><tbody><tr><td>Stream Name:</td><td>thrillhouse</td></tr><tr><td>Stream Description:</td><td>A work-in-progress radio station based on some of my favorite music of the past 4-5 years.</td></tr><tr><td>Content Type:</td><td>audio/mpeg</td></tr><tr><td>Stream started:</td><td class="streamstats">Wed, 10 Jun 2026 06:08:04 -0500</td></tr><tr><td>Bitrate:</td><td class="streamstats">320</td></tr><tr><td>Listeners (current):</td><td class="streamstats" id="listener-count">0</td></tr><tr><td>Listeners (peak):</td><td class="streamstats" id="listener-peak">4</td></tr><tr><td>Genre:</td><td class="streamstats">various</td></tr><tr><td>Currently playing:</td><td class="streamstats" id="currently-playing">Japanese Breakfast - Diving Woman (Live on KEXP) [cvrbBYz11JY].mp3</td></tr><tr><td>Listen:</td><td><audio controls="controls" playsinline="playsinline" preload="none" src="https://radio.pleasetunein.com/thrillhouse">
								Your browser does not support the audio element.
							</audio></td></tr><tr><td><a href="https://radio.pleasetunein.com/thrillhouse">Player not showing? Click here to listen.</a></td></tr><tr><td id="skipTd" colspan="2" style="padding:0.8rem 0 0 0"><button id="skip-btn" style="background:#c0392b;color:#fff;border:none;border-radius:6px;padding:0.6rem 1.8rem;font-size:1rem;cursor:pointer">Skip Song</button><div id="skip-status" style="font-size:0.85rem;color:#aaa;margin-top:0.4rem;min-height:1.2em"></div></td></tr><tr><td id="reviewTd" colspan="2" style="padding:0 0 0.8rem 0"><div style="display:inline-flex;align-items:center;gap:1rem"><label style="display:inline-flex;align-items:center;gap:0.5rem;font-size:0.95rem;cursor:pointer"><input type="checkbox" id="flag-cb" style="width:1.1rem;height:1.1rem;cursor:pointer;accent-color:#e05" />
									Mark track for review
								</label><textarea id="review-notes" placeholder="Notes (optional)" style="background:transparent;border:1px solid #555;color:#eee;font-family:sans-serif;font-size:0.9rem;padding:0.3rem;resize:vertical;width:14rem"></textarea></div><div id="flag-status" style="font-size:0.85rem;color:#aaa;margin-top:0.4rem;min-height:1.2em"></div></td></tr></tbody></table></div></div><div id="footer">
		You can email feedback and suggestions to thrillhouseradio at ayy ohhhhhhh elll dott cum. 
	</div><script type="text/javascript">//
	(function () {
		var lastTrack = null;

		function updateNowPlaying() {
			fetch('/status-json.xsl')
				.then(function (r) { return r.json(); })
				.then(function (data) {
					var src = data.icestats.source;
					if (!src) return;
					if (!Array.isArray(src)) src = [src];
					var mount = src[0];
					for (var i = 0; i &lt; src.length; i++) {
						if (src[i].listenurl &amp;&amp; src[i].listenurl.indexOf('/thrillhouse') !== -1) {
							mount = src[i];
							break;
						}
					}
					var cell = document.getElementById('currently-playing');
					var nowPlaying = mount ? (mount.artist ? mount.artist + ' - ' + (mount.title || '') : (mount.title || '')) : null;
					if (cell &amp;&amp; nowPlaying != null) cell.textContent = nowPlaying;
					var listeners = document.getElementById('listener-count');
					if (listeners &amp;&amp; mount) listeners.textContent = mount.listeners != null ? mount.listeners : listeners.textContent;
					var peak = document.getElementById('listener-peak');
					if (peak &amp;&amp; mount) peak.textContent = mount.listener_peak != null ? mount.listener_peak : peak.textContent;

					if (lastTrack !== null &amp;&amp; nowPlaying !== null &amp;&amp; nowPlaying !== lastTrack) {
						var flagCb = document.getElementById('flag-cb');
						var flagStatus = document.getElementById('flag-status');
						if (flagCb &amp;&amp; flagCb.checked) {
							flagCb.checked = false;
							if (flagStatus) { flagStatus.textContent = ''; }
						}
					}
					if (nowPlaying !== null) lastTrack = nowPlaying;
				})
				.catch(function () {});
		}
		setInterval(updateNowPlaying, 10000);
	})();
	
	(function () {
		var isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) &amp;&amp; !window.MSStream;

		if (isIOS) {
			window.location.replace("https://radio.pleasetunein.com/ios.html");
		}
	})();
	(function () {
		var skipBtn = document.getElementById('skip-btn');
		var skipStatus = document.getElementById('skip-status');
		var COOLDOWN_MS = 20000;
		if (!skipBtn) return;

		skipBtn.addEventListener('click', function () {
			skipBtn.disabled = true;
			skipStatus.style.color = '#aaa';
			skipStatus.textContent = 'Skipping…';

			fetch('https://radio.pleasetunein.com/api/skip', { method: 'POST', headers: { 'Content-Type': 'application/json' } })
				.then(function (res) {
					return res.json().then(function (data) { return { status: res.status, data: data }; });
				})
				.then(function (result) {
					if (result.status === 429) {
						skipStatus.style.color = '#e74c3c';
						skipStatus.textContent = result.data.message || 'Still on cooldown.';
						skipBtn.disabled = false;
					} else {
						skipStatus.style.color = '#2ecc71';
						skipStatus.textContent = 'Skipped!';
						startCooldown(COOLDOWN_MS);
					}
				})
				.catch(function () {
					skipStatus.style.color = '#e74c3c';
					skipStatus.textContent = 'Could not reach the server.';
					skipBtn.disabled = false;
				});
		});

		function startCooldown(ms) {
			var end = Date.now() + ms;
			var tick = setInterval(function () {
				var remaining = Math.ceil((end - Date.now()) / 1000);
				if (remaining &lt;= 0) {
					clearInterval(tick);
					skipBtn.disabled = false;
					skipStatus.textContent = '';
				} else {
					skipStatus.style.color = '#aaa';
					skipStatus.textContent = 'Cooldown: ' + remaining + 's';
				}
			}, 250);
		}
	})();

	(function () {
		var flagCb = document.getElementById('flag-cb');
		var flagStatus = document.getElementById('flag-status');
		if (!flagCb) return;

		flagCb.addEventListener('change', function () {
			if (!flagCb.checked) return;

			var notesEl = document.getElementById('review-notes');
			var message = (notesEl &amp;&amp; notesEl.value.trim()) || (document.getElementById('currently-playing') || {}).textContent || 'DEFAULT NOTES';
			flagCb.disabled = true;
			flagStatus.style.color = '#aaa';
			flagStatus.textContent = 'Flagging…';

			fetch('https://radio.pleasetunein.com/api/improve', {
				method: 'POST',
				headers: { 'Content-Type': 'application/json' },
				body: JSON.stringify({ message: message })
			})
				.then(function (res) {
					if (res.ok) {
						flagStatus.style.color = '#2ecc71';
						flagStatus.textContent = 'Track flagged for review.';
					} else {
						flagCb.checked = false;
						flagStatus.style.color = '#e74c3c';
						flagStatus.textContent = 'Server error (' + res.status + ').';
					}
					flagCb.disabled = false;
				})
				.catch(function () {
					flagCb.checked = false;
					flagStatus.style.color = '#e74c3c';
					flagStatus.textContent = 'Could not reach the server.';
					flagCb.disabled = false;
				});
		});
	})();
	//</script></body>
</html>
