Make radio check the stream endpoint
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m22s

This commit is contained in:
2026-03-10 13:40:51 +00:00
parent 5b041d7364
commit 857f66cb37

View File

@@ -20,23 +20,17 @@ import Header from "@/components/text/Header.vue";
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import axios from "axios"; import axios from "axios";
const streamMount = ref("");
const streamUrl = ref(""); const streamUrl = ref("");
const streamLive = ref(false); const streamLive = ref(false);
const audio = ref(null); const audio = ref(null);
async function checkStream() { async function checkStream() {
try { try {
const res = await axios.get("/radio/status-json.xsl"); await axios.head("/radio/stream");
const data = res.data;
streamMount.value = data.icestats.source.listenurl.split("/").pop();
if (streamMount.value) {
streamLive.value = true; streamLive.value = true;
streamUrl.value = "/radio/" + streamMount.value; streamUrl.value = "/radio/stream";
if (audio.value) audio.value.load(); if (audio.value) audio.value.load();
}
} catch (err) { } catch (err) {
streamLive.value = false; streamLive.value = false;
} }