-
-
Stream is currently offline.
+
+

+
+
+
+

+
Stream is currently offline.
@@ -18,9 +22,8 @@ async function checkStream() {
try {
const res = await fetch("/radio/status-json.xsl"); // Icecast JSON status
const data = await res.json();
- // Replace 'mounts' and '/stream' with your Icecast mountpoint
- streamMount.value = data.icestats.source.listenurl.split("/").pop();
+ streamMount.value = data.icestats.source.listenurl.split("/").pop();
if (streamMount.value) {
streamLive.value = true;
streamUrl.value = "/radio/" + streamMount.value;
@@ -31,6 +34,22 @@ async function checkStream() {
streamLive.value = false;
}
}
+
+onMounted(() => {
+ checkStream();
+ setInterval(checkStream, 30000);
+});
-
+
diff --git a/nginx/vue/src/components/Spotify.vue b/nginx/vue/src/components/Spotify.vue
index 156511f..354542a 100644
--- a/nginx/vue/src/components/Spotify.vue
+++ b/nginx/vue/src/components/Spotify.vue
@@ -1,10 +1,13 @@
-
-
![]()
-
Song: {{ songName }}
-
Artist: {{ artistName }}
-
Status: Playing
-
Status: Not playing
+
+
![]()
+
Song: {{ songName }}
+
Artist: {{ artistName }}
+
Is what im currently listening to rnrnrn ^_^
+
+
+

+
I ain't listenin to nofin
@@ -20,20 +23,25 @@ export default {
const songUrl = ref("");
const playing = ref(false);
- const fetchSpotify = async () => {
+ async function fetchSpotify() {
try {
const res = await fetch("/api/spotify");
if (!res.ok) throw new Error("Failed to fetch Spotify data");
const data = await res.json();
- albumImage.value = data.album_image;
- artistName.value = data.artist_name;
- songUrl.value = data.song_url;
- songName.value = data.song_name;
- playing.value = data.playing;
+ if (playing.value == false) {
+ return;
+ } else {
+ albumImage.value = data.album_image;
+ artistName.value = data.artist_name;
+ songUrl.value = data.song_url;
+ songName.value = data.song_name;
+ playing.value = data.playing;
+ return;
+ }
} catch (err) {
console.error(err);
}
- };
+ }
onMounted(() => {
fetchSpotify();
@@ -60,11 +68,10 @@ export default {
box-shadow: 3px;
}
-.spotify-now-playing img {
- width: 200px;
- height: 200px;
- object-fit: cover;
- box-shadow: 3px;
- margin-bottom: 10px;
+.spotify-not-playing {
+ border: 2px solid black;
+ align-items: center;
+ text-align: center;
+ background: white;
}
diff --git a/nginx/vue/src/views/Home.vue b/nginx/vue/src/views/Home.vue
index e1bfb26..6c127a9 100644
--- a/nginx/vue/src/views/Home.vue
+++ b/nginx/vue/src/views/Home.vue
@@ -6,30 +6,47 @@ import Radio from "@/components/Radio.vue";
-
Welcome
-

-
-
whoami?
-
Hi im Adam
+
+

+
Welcome
+
Hi im Adam
+
-
cv
-
cv
+
+
+

+
cv
+
-
-
bookmarks
- bookmarks
-
+
-
-
Shrines
- gto
- demoman
- skipskipbenben
- evangelion
-
+
@@ -44,8 +61,8 @@ import Radio from "@/components/Radio.vue";
main {
display: flex;
flex-wrap: wrap;
- flex-direction: column;
- align-items: center;
+ flex-direction: row;
+ /*align-items: center;*/
justify-content: center;
gap: 1rem;
}