From 773e0ea906fefb8918fd53349c31e80fa6aaf3f3 Mon Sep 17 00:00:00 2001 From: joel Date: Sun, 5 May 2024 18:55:29 +0100 Subject: [PATCH] restored upvotes --- ui/app.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ui/app.vue b/ui/app.vue index 0fc7cf9..f46efa5 100644 --- a/ui/app.vue +++ b/ui/app.vue @@ -27,6 +27,7 @@
+
@@ -38,12 +39,24 @@ const playlist = ref([]); const nowPlaying = ref({}); + const upVoteText = ref("Upvote this bop"); + const upVoteShitpost = [ + "Upgrade to LanOps premiumâ„¢ to unlock this feature", + "Shit taste, no thanks", + 'Song "upvoted"', + "Purchase a lanops box and key for a chance to unlock upvotes" + ] const skipText = ref("Vote song uploader is a cunt"); async function refreshPlaylist () { playlist.value = await $fetch(runtimeConfig.public.apiEndpoint + `/tracks`).catch((error) => error.data) } + async function voteUp() { + upVoteText.value = upVoteShitpost[Math.floor(Math.random() * upVoteShitpost.length)]; + + } + async function voteDown() { try { await $fetch(`${runtimeConfig.public.apiEndpoint}/votes/skip`, {method: 'POST', body: { uri: nowPlaying.value.uri }})